Skip to content

Commit

Permalink
Remove PrepareAllQueries
Browse files Browse the repository at this point in the history
I never used it so I think usage is probably low. Complicates the pgx v5
upgrade, so drop it.

It's easy enough to workaround by writing the prepare manually.

Additionally, it won't work well if we eventually support dynamic queries.
  • Loading branch information
jschaf committed Jan 2, 2024
1 parent 1018a30 commit eccbe09
Show file tree
Hide file tree
Showing 27 changed files with 0 additions and 857 deletions.
50 changes: 0 additions & 50 deletions example/author/query.sql.go

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

27 changes: 0 additions & 27 deletions example/author/query.sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,6 @@ func TestNewQuerier_FindAuthors(t *testing.T) {
})
}

func TestNewQuerier_FindAuthors_PrepareAllQueries(t *testing.T) {
conn, cleanup := pgtest.NewPostgresSchema(t, []string{"schema.sql"},
pgtest.WithGuardedStmtCache(findAuthorsSQL))
defer cleanup()
q := NewQuerier(conn)
adamsID := insertAuthor(t, q, "john", "adams")

t.Run("PrepareAllQueries", func(t *testing.T) {
err := PrepareAllQueries(context.Background(), conn)
require.NoError(t, err)
})

t.Run("FindAuthors - 1 row - john", func(t *testing.T) {
authors, err := q.FindAuthors(context.Background(), "john")
require.NoError(t, err)
want := []FindAuthorsRow{
{
AuthorID: adamsID,
FirstName: "john",
LastName: "adams",
Suffix: nil,
},
}
assert.Equal(t, want, authors)
})
}

func TestNewQuerier_FindFirstNames(t *testing.T) {
conn, cleanup := pgtest.NewPostgresSchema(t, []string{"schema.sql"})
defer cleanup()
Expand Down
32 changes: 0 additions & 32 deletions example/complex_params/query.sql.go

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

32 changes: 0 additions & 32 deletions example/composite/query.sql.go

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

26 changes: 0 additions & 26 deletions example/custom_types/query.sql.go

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

38 changes: 0 additions & 38 deletions example/device/query.sql.go

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

20 changes: 0 additions & 20 deletions example/domain/query.sql.go

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

35 changes: 0 additions & 35 deletions example/enums/query.sql.go

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

38 changes: 0 additions & 38 deletions example/erp/order/customer.sql.go

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

Loading

0 comments on commit eccbe09

Please sign in to comment.