Skip to content

Commit

Permalink
Update sql dependency and use default column options mapper (#64)
Browse files Browse the repository at this point in the history
* Update sql dependency and use default column options mapper

* Update sql dependency
  • Loading branch information
lafriks authored Sep 28, 2023
1 parent f1228fe commit 4ea1e88
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Setup PostgreSQL
uses: harmon758/postgresql-action@v1
with:
Expand Down Expand Up @@ -48,7 +50,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Start posgresql containers
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module github.com/go-rel/postgres

go 1.20
go 1.21

toolchain go1.21.0

require (
github.com/go-rel/primaryreplica v0.5.0
github.com/go-rel/rel v0.40.0
github.com/go-rel/sql v0.15.0
github.com/go-rel/sql v0.15.1-0.20230927020931-5b67559d2fe1
github.com/jackc/pgx/v4 v4.18.1
github.com/lib/pq v1.10.9
github.com/stretchr/testify v1.8.4
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-rel/primaryreplica v0.5.0 h1:pIxgIgED/qnp2P3sZbrZxlB7EXmQf8KoBaRMddXL61E=
github.com/go-rel/primaryreplica v0.5.0/go.mod h1:GeFi8vTz/XtLVz+eZSWlmy02+hwd1vAsy4te0JYQbq4=
github.com/go-rel/rel v0.40.0 h1:Av2/Ub6fQn6UbwxTIHStfLb7W+knRhOVX8AWcC+pOBA=
github.com/go-rel/rel v0.40.0/go.mod h1:6opWRxsoHoDq67fIDnsmcmnojpskWpPqCs0AoL/UrEU=
github.com/go-rel/sql v0.15.0 h1:/OqPJfKpy/M/bWwkmQF+RJ9RALqfoOY3KPDAjS/A6D4=
github.com/go-rel/sql v0.15.0/go.mod h1:gL4ljbWWc0LBCXAtWKPwO2vLkU6+7HaXXuvvo3ngld8=
github.com/go-rel/sql v0.15.1-0.20230927020931-5b67559d2fe1 h1:K3wgZUbotCQT/a8S9/ZuPOfz77AqHiPNZHRm9DWlVnA=
github.com/go-rel/sql v0.15.1-0.20230927020931-5b67559d2fe1/go.mod h1:9Jy+N+nTTjlq9QZquoj19tppYuBXMz2grOtTN6HBD3U=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
Expand Down Expand Up @@ -107,6 +108,7 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4=
Expand Down Expand Up @@ -264,6 +266,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func New(database *db.DB) rel.Adapter {
deleteBuilder = builder.Delete{BufferFactory: bufferFactory, Query: queryBuilder, Filter: filterBuilder}
ddlBufferFactory = builder.BufferFactory{InlineValues: true, BoolTrueValue: "true", BoolFalseValue: "false", Quoter: Quote{}, ValueConverter: ValueConvert{}}
ddlQueryBuilder = builder.Query{BufferFactory: ddlBufferFactory, Filter: filterBuilder}
tableBuilder = builder.Table{BufferFactory: ddlBufferFactory, ColumnMapper: columnMapper, DropKeyMapper: sql.DropKeyMapper}
tableBuilder = builder.Table{BufferFactory: ddlBufferFactory, ColumnMapper: columnMapper, ColumnOptionsMapper: sql.ColumnOptionsMapper, DropKeyMapper: sql.DropKeyMapper}
indexBuilder = builder.Index{BufferFactory: ddlBufferFactory, Query: ddlQueryBuilder, Filter: filterBuilder, SupportFilter: true}
)

Expand Down
4 changes: 2 additions & 2 deletions quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestQuote_Panic(t *testing.T) {
func TestQuote_ID(t *testing.T) {
quoter := Quote{}

var cases = []struct {
cases := []struct {
input string
want string
}{
Expand All @@ -36,7 +36,7 @@ func TestQuote_ID(t *testing.T) {
func TestQuote_Value(t *testing.T) {
quoter := Quote{}

var cases = []struct {
cases := []struct {
input string
want string
}{
Expand Down

0 comments on commit 4ea1e88

Please sign in to comment.