-
Notifications
You must be signed in to change notification settings - Fork 925
v1.23.0 #2909
-
What's new
Database-backed query analysis
With a database connection configured, sqlc generate
will gather metadata from that database to support its query analysis. Turning this on resolves a large number of issues in the backlog related to type inference and more complex queries. The easiest way to try it out is with managed databases.
The database-backed analyzer currently supports PostgreSQL, with MySQL and SQLite support planned in the future.
New createdb
command
When you have a cloud project configured, you can use the new sqlc createdb
command to spin up a new ephemeral database with your schema and print its connection string to standard output. This is useful for integrating with other tools. Read more in the managed databases documentation.
Support for pgvector
If you're using pgvector, say goodbye to custom overrides! sqlc now generates code using pgvector-go as long as you're using pgx
. The pgvector extension is also available in managed databases.
Go build tags
With the new emit_build_tags
configuration parameter you can set build tags for sqlc to add at the top of generated source files.
What's Changed
- chore(endtoend): Fix test output for do tests by @kyleconroy in chore(endtoend): Fix test output for do tests #2782
- docs: Add stable anchors to changelog by @kyleconroy in docs: Add stable anchors to changelog #2784
- build(deps): bump packaging from 23.1 to 23.2 in /docs by @dependabot in build(deps): bump packaging from 23.1 to 23.2 in /docs #2791
- Update changelog.md by @kyleconroy in Update changelog.md #2796
- docs: Add sqlc upload to CI / CD guide by @kyleconroy in docs: Add sqlc upload to CI / CD guide #2797
- build(deps): bump urllib3 from 2.0.5 to 2.0.6 in /docs by @dependabot in build(deps): bump urllib3 from 2.0.5 to 2.0.6 in /docs #2798
- build(deps): bump babel from 2.12.1 to 2.13.0 in /docs by @dependabot in build(deps): bump babel from 2.12.1 to 2.13.0 in /docs #2799
- test(endtoend): Split shema and queries by @kyleconroy in test(endtoend): Split shema and queries #2803
- test: Fix a few incorrect testcases by @kyleconroy in test: Fix a few incorrect testcases #2804
- build(deps): bump golang.org/x/sync from 0.3.0 to 0.4.0 by @dependabot in build(deps): bump golang.org/x/sync from 0.3.0 to 0.4.0 #2810
- build(deps): bump golang from 1.21.1 to 1.21.2 by @dependabot in build(deps): bump golang from 1.21.1 to 1.21.2 #2811
- feat(codegen): add support for build tags (Being able to mark generated files with go:build tags #2012 ) by @Hyuga-Tsukui in feat(codegen): add support for build tags (#2012) #2807
- docs: fix broken link, add clarity to plugins doc by @andrewmbenton in docs: fix broken link, add clarity to plugins doc #2813
- feat(generate): reorder codegen handlers to prefer plugins by @andrewmbenton in feat(generate): reorder codegen handlers to prefer plugins #2814
- docs: add clarity and reference to JSON tags by @kalogs-c in docs: add clarity and reference to JSON tags #2819
- build(deps): bump github.com/google/go-cmp from 0.5.9 to 0.6.0 by @dependabot in build(deps): bump github.com/google/go-cmp from 0.5.9 to 0.6.0 #2826
- build(deps): bump golang from 1.21.2 to 1.21.3 by @dependabot in build(deps): bump golang from 1.21.2 to 1.21.3 #2824
- build(deps): bump google.golang.org/grpc from 1.58.2 to 1.58.3 by @dependabot in build(deps): bump google.golang.org/grpc from 1.58.2 to 1.58.3 #2825
- ci: bump go version in workflows by @andrewmbenton in ci: bump go version in workflows #2835
- refactor(codegen): remove golang and json settings from plugin proto by @andrewmbenton in refactor(codegen): remove golang and json settings from plugin proto #2822
- feat(devenv): add vscode settings.json with auto newline by @andrewmbenton in feat(devenv): add vscode settings.json with auto newline #2834
- feat(generate): support yml extension by @xsadia in feat(generate): support yml extension #2828
- build(deps): bump golang.org/x/net from 0.12.0 to 0.17.0 by @dependabot in build(deps): bump golang.org/x/net from 0.12.0 to 0.17.0 #2836
- feat(analyzer): Analyze queries using a running PostgreSQL database by @kyleconroy in feat(analyzer): Analyze queries using a running PostgreSQL database #2805
- fix(codegen): Correct column names in :copyfrom by @kyleconroy in fix(codegen): Correct column names in :copyfrom #2838
- feat(sql/ast): Render AST to SQL by @kyleconroy in feat(sql/ast): Render AST to SQL #2815
- docs: Replace form with dashboard link by @kyleconroy in docs: Replace form with dashboard link #2840
- fix(compiler): Search SELECT and UPDATE the same way by @kyleconroy in fix(compiler): Search SELECT and UPDATE the same way #2841
- fix(dolphin): Support more UNIONs for MySQL by @kyleconroy in fix(dolphin): Support more UNIONs for MySQL #2843
- fix(compiler): Account for parameters without parents by @kyleconroy in fix(compiler): Account for parameters without parents #2844
- fix(postgresql): Remove temporary pool config by @kyleconroy in fix(postgresql): Remove temporary pool config #2851
- fix(golang): Escape reserved keywords by @kyleconroy in fix(golang): Escape reserved keywords #2849
- fix(mysql): Handle simplified CASE statements by @kyleconroy in fix(mysql): Handle simplified CASE statements #2852
- feat(codegen): Include plugin information by @kyleconroy in feat(codegen): Include plugin information #2846
- fix(engine/dolphin): support enum in ALTER definition by @sapk in fix(engine/dolphin): support enum in ALTER definition #2680
- fix(mysql): Add, drop, rename and change enum values by @kyleconroy in fix(mysql): Add, drop, rename and change enum values #2853
- feat(postgresql): Add ALTER VIEW ... SET SCHEMA by @kyleconroy in feat(postgresql): Add ALTER VIEW ... SET SCHEMA #2855
- fix(config): Validate
database
config in all cases by @andrewmbenton in fix(config): Validatedatabase
config in all cases #2856 - test: Add more database analyzer test cases by @kyleconroy in test: Add more database analyzer test cases #2854
- feat(compiler): Parse query parameter metadata from comments by @andrewmbenton in feat(compiler): Parse query parameter metadata from comments #2850
- fix(compiler): Use correct func signature for
CommentSyntax
on windows by @andrewmbenton in fix(compiler): Use correct func signature forCommentSyntax
on windows #2867 - fix(codegen/go): Prevent filtering of embedded struct fields by @andrewmbenton in fix(codegen/go): Prevent filtering of embedded struct fields #2868
- fix(compiler): Support functions with OUT params by @kyleconroy in fix(compiler): Support functions with OUT params #2865
- docs: Update examples to use pgx/v5 by @andrewmbenton in docs: Update examples to use pgx/v5 #2863
- test: Add more analyzer test cases by @andrewmbenton in test: Add more analyzer test cases #2866
- build(deps): bump urllib3 from 2.0.6 to 2.0.7 in /docs by @dependabot in build(deps): bump urllib3 from 2.0.6 to 2.0.7 in /docs #2872
- patch: use docker compose v2 and update MYSQL_DATABASE env var by @juanjuanzero in patch: use docker compose v2 and update MYSQL_DATABASE env var #2870
- build(deps): bump google.golang.org/grpc from 1.58.3 to 1.59.0 by @dependabot in build(deps): bump google.golang.org/grpc from 1.58.3 to 1.59.0 #2876
- feat(postgresql): Support system columns on tables by @kyleconroy in feat(postgresql): Support system columns on tables #2871
- feat(compiler): Support LEFT JOIN on aliased table by @kyleconroy in feat(compiler): Support LEFT JOIN on aliased table #2873
- fix(compiler): Pull in array information from analyzer by @kyleconroy in fix(compiler): Pull in array information from analyzer #2864
- test: Add more test cases for new analyzer by @kyleconroy in test: Add more test cases for new analyzer #2879
- feat: Improve messaging for common cloud config and rpc errors by @andrewmbenton in feat: Improve messaging for common cloud config and rpc errors #2885
- fix(analyzer): Error on unexpanded star expression by @kyleconroy in fix(analyzer): Error on unexpanded star expression #2882
- test(endtoend): Enabled managed-db tests in CI by @kyleconroy in test(endtoend): Enabled managed-db tests in CI #2883
- feat: Abort compiler when rpc fails as unauthenticated by @andrewmbenton in feat: Abort compiler when rpc fails as unauthenticated #2887
- feat(codegen): Add support for pgvector and pgvector-go by @kyleconroy in feat(codegen): Add support for pgvector and pgvector-go #2888
- docs: Update getting started guides, use pgx for Postgres guide by @andrewmbenton in docs: Update getting started guides, use pgx for Postgres guide #2891
- docs: Use managed databases in PostgreSQL getting started guide by @andrewmbenton in docs: Use managed databases in PostgreSQL getting started guide #2892
- test: Enabled pgvector tests for managed dbs by @kyleconroy in test: Enabled pgvector tests for managed dbs #2893
- feat(analyzer): Cache query analysis by @kyleconroy in feat(analyzer): Cache query analysis #2889
- fix(vet): Remove rollback statements from DDL by @kyleconroy in fix(vet): Remove rollback statements from DDL #2895
- feat(createdb): Create ephemeral databases by @kyleconroy in feat(createdb): Create ephemeral databases #2894
- docs: Update managed databases doc to discuss codegen by @andrewmbenton in docs: Update managed databases doc to discuss codegen #2897
- docs: Add managed dbs to CI/CD and vet guides by @kyleconroy in docs: Add managed dbs to CI/CD and vet guides #2896
- feat(debug): Add databases=managed debug option by @kyleconroy in feat(debug): Add databases=managed debug option #2898
- build(deps): Upgrade wasmtime-go from 13.0.0 to 14.0.0 by @kyleconroy in build(deps): Upgrade wasmtime-go from 13.0.0 to 14.0.0 #2900
- feat(config): Remove managed database validation by @kyleconroy in feat(config): Remove managed database validation #2901
- refactor(codegen): Removed deprecated code and improved speed by @quenbyako in refactor(codegen): Removed deprecated code and improved speed #2899
- docs: Document database-backed query analyzer by @kyleconroy in docs: Document database-backed query analyzer #2904
- docs: Release notes for v1.23.0 by @andrewmbenton in docs: Release notes for v1.23.0 #2907
- Release v1.23.0 by @kyleconroy in Release v1.23.0 #2908
New Contributors
- @Hyuga-Tsukui made their first contribution in feat(codegen): add support for build tags (#2012) #2807
- @kalogs-c made their first contribution in docs: add clarity and reference to JSON tags #2819
- @xsadia made their first contribution in feat(generate): support yml extension #2828
- @sapk made their first contribution in fix(engine/dolphin): support enum in ALTER definition #2680
- @juanjuanzero made their first contribution in patch: use docker compose v2 and update MYSQL_DATABASE env var #2870
- @quenbyako made their first contribution in refactor(codegen): Removed deprecated code and improved speed #2899
Full Changelog: v1.22.0...v1.23.0
This discussion was created from the release v1.23.0.
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 4 -
🚀 2