Skip to content

Commit

Permalink
More experiments with codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaf committed Jan 6, 2024
1 parent 4bb40e2 commit 500b5c6
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 190 deletions.
86 changes: 62 additions & 24 deletions example/author/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions example/author/query.sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ func TestNewQuerier_FindAuthors(t *testing.T) {
assert.Equal(t, want, authors)
})

t.Run("FindAuthors - 1 row suffix - bill", func(t *testing.T) {
insRow, err := q.InsertAuthorSuffix(context.Background(), InsertAuthorSuffixParams{
FirstName: "bill",
LastName: "clinton",
Suffix: "jr",
})
authors, err := q.FindAuthors(context.Background(), "bill")
require.NoError(t, err)
want := []FindAuthorsRow{
{
AuthorID: insRow.AuthorID,
FirstName: "bill",
LastName: "clinton",
Suffix: ptrs.String("jr"),
},
}
assert.Equal(t, want, authors)
})

t.Run("FindAuthors - 2 rows - george", func(t *testing.T) {
authors, err := q.FindAuthors(context.Background(), "george")
require.NoError(t, err)
Expand Down
7 changes: 0 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ require (
github.com/docker/docker v24.0.7+incompatible
github.com/docker/go-connections v0.4.0
github.com/google/go-cmp v0.6.0
github.com/jackc/pgconn v1.14.1
github.com/jackc/pgproto3/v2 v2.3.2
github.com/jackc/pgtype v1.14.0
github.com/jackc/pgx/v4 v4.18.1
github.com/jackc/pgx/v5 v5.5.1
github.com/peterbourgon/ff/v3 v3.4.0
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.8.4
golang.org/x/mod v0.11.0
)
Expand All @@ -24,8 +19,6 @@ require (
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/kr/text v0.2.0 // indirect
Expand Down
Loading

0 comments on commit 500b5c6

Please sign in to comment.