Releases: sqlc-dev/sqlc
v1.18.0
What's New
Remote code generation
Developed by @andrewmbenton
At its core, sqlc is powered by SQL engines, which include parsers, formatters,
analyzers and more. While our goal is to support each engine on each operating
system, it's not always possible. For example, the PostgreSQL engine does not
work on Windows.
To bridge that gap, we're announcing remote code generation, currently in
private alpha. To join the private alpha, sign up for the waitlist.
To configure remote generation, configure a cloud
block in sqlc.json
.
{
"version": "2",
"cloud": {
"organization": "<org-id>",
"project": "<project-id>",
},
...
}
You'll also need to the SQLC_AUTH_TOKEN
environment variable.
export SQLC_AUTH_TOKEN=<token>
When the cloud configuration exists, sqlc generate
will default to remote
generation. If you'd like to generate code locally, pass the --no-remote
option.
sqlc generate --no-remote
Remote generation is off by default and requires an opt-in to use.
sqlc.embed
Developed by @nickjackson
Embedding allows you to reuse existing model structs in more queries, resulting
in less manual serilization work. First, imagine we have the following schema
with students and test scores.
CREATE TABLE students (
id bigserial PRIMARY KEY,
name text,
age integer
)
CREATE TABLE test_scores (
student_id bigint,
score integer,
grade text
)
We want to select the student record and the highest score they got on a test.
Here's how we'd usually do that:
-- name: HighScore :many
WITH high_scores AS (
SELECT student_id, max(score) as high_score
FROM test_scores
GROUP BY 1
)
SELECT students.*, high_score::integer
FROM students
JOIN high_scores ON high_scores.student_id = students.id;
When using Go, sqlc will produce a struct like this:
type HighScoreRow struct {
ID int64
Name sql.NullString
Age sql.NullInt32
HighScore int32
}
With embedding, the struct will contain a model for the table instead of a
flattened list of columns.
-- name: HighScoreEmbed :many
WITH high_scores AS (
SELECT student_id, max(score) as high_score
FROM test_scores
GROUP BY 1
)
SELECT sqlc.embed(students), high_score::integer
FROM students
JOIN high_scores ON high_scores.student_id = students.id;
type HighScoreRow struct {
Student Student
HighScore int32
}
sqlc.slice
Developed by Paul Cameron and Jille Timmermans
The MySQL Go driver does not support passing slices to the IN operator. The
sqlc.slice
function generates a dynamic query at runtime with the correct
number of parameters.
/* name: SelectStudents :many */
SELECT * FROM students
WHERE age IN (sqlc.slice("ages"))
func (q *Queries) SelectStudents(ctx context.Context, arges []int32) ([]Student, error) {
This feature is only supported in MySQL and cannot be used with prepared
queries.
Batch operation improvements
When using batches with pgx, the error returned when a batch is closed is
exported by the generated package. This change allows for cleaner error
handling using errors.Is
.
errors.Is(err, generated_package.ErrBatchAlreadyClosed)
Previously, you would have had to check match on the error message itself.
err.Error() == "batch already closed"
The generated code for batch operations always lived in batch.go
. This file
name can now be configured via the output_batch_file_name
configuration
option.
Configurable query parameter limits for Go
By default, sqlc will limit Go functions to a single parameter. If a query
includes more than one parameter, the generated method will use an argument
struct instead of positional arguments. This behavior can now be changed via
the query_parameter_limit
configuration option. If set to 0
, every
generated method will use a argument struct.
What's Changed
- Upgrade to Go 1.20 by @kyleconroy in #2105
- test: Skip tests if required plugins are missing by @kyleconroy in #2104
- fix: Prevent variable redeclaration in single param conflict for pgx by @zaneli in #2058
- fix: Retrieve Larg/Rarg join query after inner join by @zaneli in #2051
- fix: Rename argument when conflicted to imported package by @zaneli in #2048
- fix: pgx closed batch return pointer if need #1959 by @flymedllva in #1960
- parser: Generate correct types for
SELECT NOT EXISTS
by @haines in #1972 - Implement ALTER TYPE SET SCHEMA by @linux2647 in #2027
- Fix test: Bump version to v1.17.2 in internal/endtoend/testdata/ddl_alter_type_set_schema/postgresql by @monkey-mas in #2108
- build(deps): bump github.com/antlr/antlr4/runtime/Go/antlr from 0.0.0-20220626175859-9abda183db8e to 1.4.10 by @dependabot in #2109
- Implement support for enum ordering by @mikemherron in #2111
- engine/postgres: Upgrade to pg_query_go/v4 by @kyleconroy in #2114
- build(deps): bump github.com/jackc/pgx/v4 from 4.18.0 to 4.18.1 by @dependabot in #2119
- Enum ordering minor code tidy up by @mikemherron in #2126
- build(deps): bump golang from 1.20.1 to 1.20.2 by @dependabot in #2135
- build(deps): bump google.golang.org/protobuf from 1.28.1 to 1.29.0 by @dependabot in #2137
- allow deleting composite types by @josharian in #2138
- Fix typo (incorrect domain in URL) by @starquake in #2142
- build(deps): bump google.golang.org/protobuf from 1.29.0 to 1.29.1 by @dependabot in #2143
- docs(config.md): add
sqlite
as engine option by @aaanders in #2164 - Add link to introductory blog post by @meblum in #2155
- cmd/sqlc: Remove --experimental flag by @kyleconroy in #2170
- docs: Add first pass at pgx documentation by @kyleconroy in #2174
- sqlite: Add support for CREATE TABLE ... STRICT by @kyleconroy in #2175
- cmd/sqlc: Add option to disable process-based plugins by @kyleconroy in #2180
- codegen: Correctly generate CopyFrom columns for single-column copyfroms by @Jille in #2185
- More consistent filename formatting in codegen stderr output by @andrewmbenton in #2186
- docs: Add missed configuration option by @abekoh in #2188
- bin/sqlc: Add SQLCTMPDIR environment variable by @kyleconroy in #2189
- fix: correct singularization of "waves" by @rliebz in #2194
- Add sqlc.slice() to support IN clauses in MySQL (#695) by @Jille in #1816
- feat: add
sqlc.embed
to allow model re-use by @nickjackson in #1615 - feat(Go):Add query_parameter_limit conf to codegen by @go-mez in #1558
- fix: Honor Package level renames in v2 yaml config by @Emyrk in #2001
- tests: Add tests for reanme fix in v2 by @kyleconroy in #2196
- build(deps): bump golang from 1.20.2 to 1.20.3 by @dependabot in #2192
- build(deps): bump actions/setup-go from 3 to 4 by @dependabot in #2150
- build(deps): bump google.golang.org/protobuf from 1.29.1 to 1.30.0 by @dependabot in #2151
- build(deps): bump github.com/spf13/cobra from 1.6.1 to 1.7.0 by @dependabot in #2193
- fix:
specifies parameter ":one" without containing a RETURNING clause
by @ihatov08 in #2173 - Customizable batch output file name (add OutputBatchFileName field) by @JordanP in #2178
- fix: update panic #1590 by @nusr in #2154
- Define base error in batch.go for better error handling by @Aisoipheo in #2147
- fix: mysql delete join panic by @nusr in #2197
- config: Add top-level cloud configuration by @kyleconroy in #2204
- Use os.CreateTemp() to remove ioutil dependency by @andrewmbenton in #2216
- Avoid some unnecessary buffering when reading config file by @andrewmbenton in #2215
- Add remote execution for codegen by @andrewmbenton in #2214
- fix panic caused by invalid shorthand for
--no-remote
flag by @andrewmbenton in #2218 - build(deps): bump github.co...
v1.17.2
What's Changed
- Report test results to BuildKite by @kyleconroy in #2075
- ci: Only report test results on main by @kyleconroy in #2081
- Fix for issue #2073 by @andrewmbenton in #2078
- build(deps): bump golang from 1.20.0 to 1.20.1 by @dependabot in #2082
- Updated the yaml formatting in the first section by @Mehty in #2086
- Revert "docker: Change ENTRYPOINT to CMD" by @kyleconroy in #2091
- Remove direct use of pgtype.Array with pgx/v5 by @carlmjohnson in #2090
- fix: Do not throw error when IF NOT EXISTS is used on ADD COLUMN by @jkradddic in #2092
- Prevent panics when building argument lists for variadic functions by @andrewmbenton in #2093
- add: float support mysql by @Hirochon in #2097
- Update error message for PostgreSQL engine by @kyleconroy in #2100
- cmd/sqlc: Bump version to 1.17.1 by @kyleconroy in #2101
New Contributors
- @andrewmbenton made their first contribution in #2078
- @Mehty made their first contribution in #2086
- @carlmjohnson made their first contribution in #2090
- @jkradddic made their first contribution in #2092
Full Changelog: v1.17.0...v1.17.1
v1.17.1
Note
This release contained a build failure for Windows and will not be released. Please see v1.17.2
What's Changed
- Report test results to BuildKite by @kyleconroy in #2075
- ci: Only report test results on main by @kyleconroy in #2081
- Fix for issue #2073 by @andrewmbenton in #2078
- build(deps): bump golang from 1.20.0 to 1.20.1 by @dependabot in #2082
- Updated the yaml formatting in the first section by @Mehty in #2086
- Revert "docker: Change ENTRYPOINT to CMD" by @kyleconroy in #2091
- Remove direct use of pgtype.Array with pgx/v5 by @carlmjohnson in #2090
- fix: Do not throw error when IF NOT EXISTS is used on ADD COLUMN by @jkradddic in #2092
- Prevent panics when building argument lists for variadic functions by @andrewmbenton in #2093
- add: float support mysql by @Hirochon in #2097
- Update error message for PostgreSQL engine by @kyleconroy in #2100
- cmd/sqlc: Bump version to 1.17.1 by @kyleconroy in #2101
New Contributors
- @andrewmbenton made their first contribution in #2078
- @Mehty made their first contribution in #2086
- @carlmjohnson made their first contribution in #2090
- @jkradddic made their first contribution in #2092
Full Changelog: v1.17.0...v1.17.1
v1.17.0
## What's Changed
- codegen: Remove built-in Kotlin support by @kyleconroy in #1935
- codegen: Remove built-in Python support by @kyleconroy in #1936
- Update language-support.rst by @kyleconroy in #1937
- build(deps): bump github.com/mattn/go-sqlite3 from 1.14.15 to 1.14.16 by @dependabot in #1913
- build(deps): bump github.com/spf13/cobra from 1.6.0 to 1.6.1 by @dependabot in #1909
- build: Fix devcontainer by @kyleconroy in #1942
- docker: Change ENTRYPOINT to CMD by @kyleconroy in #1943
- build: Run sqlc-pg-gen via GitHub Actions by @kyleconroy in #1944
- fix: initialize generated code outside function by @akutschera in #1850
- build: Move large arrays out of functions by @kyleconroy in #1947
- mysql: Add datatype tests by @kyleconroy in #1948
- fix(engine/mysql): take into account column's charset to distinguish text/blob, (var)char/(var)binary by @mrngm in #1895
- mysql: Fix blob tests by @kyleconroy in #1949
- Add support for emitting pointer types for nullable columns by @nickbruun in #1571
- build: Fix conflicts from pointer configuration by @kyleconroy in #1950
- [PART 2] pgx v5 support (#1823) by @mcdoker18 in #1874
- feat: Add the diff command by @kyleconroy in #1963
- [PART 3] pgx v5 support (#1823) by @mcdoker18 in #1875
- *: clean up some tiny things by @jreut in #1966
- sqlite: supported between expr (#1958) by @mcdoker18 in #1967
- Suggestion: use bufbuild to generate proto by @nickjackson in #1974
- build(deps): bump github.com/go-sql-driver/mysql from 1.6.0 to 1.7.0 by @dependabot in #1988
- tools: regenerate scripts skips dirs that contains diff exec command by @mcdoker18 in #1987
- build(deps): bump github.com/jackc/pgtype from 1.12.0 to 1.13.0 by @dependabot in #1978
- build(deps): bump golang from 1.19.3 to 1.19.4 by @dependabot in #1992
- build(deps): bump certifi from 2020.12.5 to 2022.12.7 in /docs by @dependabot in #1993
- plugins: Upgrade to go-wasmtime 3.0.2 by @kyleconroy in #2009
- add version to bug template by @davideimola in #2000
- fix: the enum Value method returns correct type by @mcdoker18 in #1996
- build(deps): bump golang from 1.19.4 to 1.19.5 by @dependabot in #2016
- update uuid docs for mysql by @mikemackintosh in #2019
- Manual fix for incorrect handling of "calories" by @mpyw in #2018
- docs: Update samples for HOW-TO GUIDES by @d-tsuji in #1953
- cmd: Generate packages in parallel by @kyleconroy in #2026
- internal/codegen: cache pattern matching compilations by @inconshreveable in #2028
- fix: Documentation for returning columns from inserted rows by @tergel-sama in #2034
- Changed documentation for json datatype. by @f1forhelp in #1997
- build(deps): bump golang from 1.19.5 to 1.20.0 by @dependabot in #2045
- fix: Add import statements even if only pointer types exist by @zaneli in #2046
- build(deps): bump github.com/jackc/pgtype from 1.13.0 to 1.14.0 by @dependabot in #2062
- fix: Search from Rexpr if not found from Lexpr by @zaneli in #2056
- build(deps): bump github.com/jackc/pgx/v4 from 4.17.2 to 4.18.0 by @dependabot in #2063
- wasm: Upgrade to wasmtime 5.0.0 by @kyleconroy in #2065
- Only enable postgresql support when cgo is enabled as it is required by @anuraaga in #2068
- cmd/sqlc: Bump version to 1.17.0 by @kyleconroy in #2066
New Contributors
- @mrngm made their first contribution in #1895
- @nickbruun made their first contribution in #1571
- @jreut made their first contribution in #1966
- @nickjackson made their first contribution in #1974
- @davideimola made their first contribution in #2000
- @mikemackintosh made their first contribution in #2019
- @d-tsuji made their first contribution in #1953
- @tergel-sama made their first contribution in #2034
- @f1forhelp made their first contribution in #1997
- @zaneli made their first contribution in #2046
- @anuraaga made their first contribution in #2068
Full Changelog: v1.16.0...v1.17.0
v1.16.0
What's Changed
- build(deps): bump github.com/jackc/pgconn from 1.12.1 to 1.13.0 by @dependabot in #1785
- docs: Add a getting started guide for SQLite by @utamori in #1798
- build(deps): bump github.com/mattn/go-sqlite3 from 1.14.13 to 1.14.15 by @dependabot in #1799
- build(deps): bump github.com/jackc/pgx/v4 from 4.16.1 to 4.17.0 by @dependabot in #1786
- feat: Add HAVING support to MySQL by @kyleconroy in #1806
- pg-gen: make sqlc-pg-gen the complete source of truth for pg_catalog.go by @skabbes in #1809
- missing " by @ChrisElliotUK in #1805
- fix(validate): sqlc.arg & sqlc.narg are not "missing" by @skabbes in #1814
- Add pg_tables and pg_views to catalog by @skabbes in #1811
- pg-gen: implement information_schema shema by @skabbes in #1815
- fix: Emit correct comment for nullable enums by @kyleconroy in #1819
- build(deps): bump github.com/jackc/pgx/v4 from 4.17.0 to 4.17.1 by @dependabot in #1825
- Python query param limit by @danicc097 in #1530
- Inflection Singular table names exclusion configuration by @danicc097 in #1531
- build(deps): bump github.com/bytecodealliance/wasmtime-go from 0.39.0 to 0.40.0 by @dependabot in #1826
- chore: Upgrade wasmtime version by @kyleconroy in #1827
- fix: π Correctly switch
coalesce()
result.NotNull
value by @mpyw in #1664 - build(deps): bump github.com/jackc/pgx/v4 from 4.17.1 to 4.17.2 by @dependabot in #1831
- build(deps): bump golang from 1.19.0 to 1.19.1 by @dependabot in #1834
- fix: prevent batch infinite loop with arg length by @chrisyxlee in #1794
- build(deps): bump github.com/google/go-cmp from 0.5.8 to 0.5.9 by @dependabot in #1838
- build(deps): bump github.com/lib/pq from 1.10.6 to 1.10.7 by @dependabot in #1835
- fix: version support in error message by @linweiyuan in #1839
- fix: handle empty column list in postgresql select statements by @akutschera in #1843
- fix: batch imports filter queries, update cmds having ret type by @chrisyxlee in #1842
- fix: named params contribute to batch parameter count by @chrisyxlee in #1841
- docs: various readability improvements by @sudomateo in #1854
- build(deps): bump github.com/bytecodealliance/wasmtime-go from 0.40.0 to 1.0.0 by @dependabot in #1857
- chore: Bump wasmtime version to v1.0.0 by @kyleconroy in #1869
- Fix a typo in config.md by @mateoradman in #1876
- Remove unnecessary
AUTOINCREMENT
from example by @thecashewtrader in #1891 - codgen: Include serialized codegen options by @kyleconroy in #1890
- build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.0 by @dependabot in #1893
- examples: Port Python examples to WASM plugin by @kyleconroy in #1903
- docs: Add documentation for codegen plugins by @kyleconroy in #1904
- [PART 1] pgx v5 support (#1823) by @mcdoker18 in #1873
- python: Port all Python tests to sqlc-gen-python by @kyleconroy in #1907
- compiler: Move Kotlin parameter logic into codegen by @kyleconroy in #1910
- Update pg_query_go to 2.2.0 / libpg_query to 13-2.2.0 by @lfittl in #1921
- build(deps): bump golang from 1.19.1 to 1.19.3 by @dependabot in #1920
- Add docs for Kotlin / Python migration by @kyleconroy in #1929
- Add deprecation warning for Python and Kotlin by @kyleconroy in #1930
- python: Upgrade to sqlc-gen-python v1.0.0 by @kyleconroy in #1932
- Port kotlin examples to sqlc-gen-kotlin by @kyleconroy in #1931
- docs: Update migration guides with links by @kyleconroy in #1933
- cmd/sqlc: Bump to v1.16.0 by @kyleconroy in #1934
New Contributors
- @ChrisElliotUK made their first contribution in #1805
- @mpyw made their first contribution in #1664
- @chrisyxlee made their first contribution in #1794
- @linweiyuan made their first contribution in #1839
- @sudomateo made their first contribution in #1854
- @mateoradman made their first contribution in #1876
- @thecashewtrader made their first contribution in #1891
- @mcdoker18 made their first contribution in #1873
- @lfittl made their first contribution in #1921
Full Changelog: v1.15.0...v1.16.0
v1.15.0
What's Changed
- docs: Add process-based plugin docs by @kyleconroy in #1669
- Update BUG_REPORT.yml by @kyleconroy in #1672
- docs: Add links to downloads.sqlc.dev by @kyleconroy in #1681
- feat: More SQL Syntax Support for SQLite by @hakobera in #1687
- Added documentation for type overriding and field renaming for the version 2 of the configuration file by @eullerpereira94 in #1695
- build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.5.0 by @dependabot in #1694
- Fixed typo by @i6u in #1700
- feat(sqlite): Promote SQLite support to beta by @kyleconroy in #1699
- feat: Codegen plugins, powered by WASM by @kyleconroy in #1684
- feat: Set user-agent for plugin downloads by @kyleconroy in #1707
- plugins(wasm): Change default cache location by @kyleconroy in #1709
- plugins(wasm): Change the SHA-256 config key by @kyleconroy in #1710
- improve mysql container support for testing by @hakobera in #1711
- build(deps): bump github.com/pganalyze/pg_query_go/v2 from 2.1.0 to 2.1.2 by @dependabot in #1715
- build(deps): bump github.com/bytecodealliance/wasmtime-go from 0.37.0 to 0.38.1 by @dependabot in #1719
- Feat/nullable enums by @sbres in #1485
- Support sqlite stdlib functions by @hakobera in #1712
- fix(postgresql): Add quotes for CamelCase columns by @akutschera in #1729
- chore: Add tests for quoting columns by @kyleconroy in #1733
- fix: cannot parse SQLite upsert statement by @hakobera in #1732
- sqlite - use []byte for blobs by @javiercbk in #1693
- fix(sqlite): Regenerate test output for builtins by @kyleconroy in #1735
- fix(wasm): Version modules by wasmtime version by @kyleconroy in #1734
- fix: missing imports for slices by @jlisthood in #1637
- test: Add tests for fixing slice imports by @kyleconroy in #1736
- test: Add test cases for returning by @kyleconroy in #1737
- feat(sqlite) add support for returning by @hakobera in #1741
- build(deps): bump golang from 1.18.3 to 1.18.4 by @dependabot in #1743
- Upgrade pingcap parser (#1759) by @akutschera in #1760
- chore: Remove catalog tests by @kyleconroy in #1762
- build(deps): bump google.golang.org/protobuf from 1.28.0 to 1.28.1 by @dependabot in #1763
- Fix typo in
docs/reference/config.md
by @Dexter2389 in #1764 - Add nowasm tag, fix nowasm inconsistency by @SN9NV in #1772
- fix: missing slice import for querier by @jlisthood in #1773
- build(deps): bump golang from 1.18.4 to 1.19.0 by @dependabot in #1768
- feat(sqlite) add support subquery and table function by @hakobera in #1771
- docs: Update transactions how to example by @jasonblanchard in #1775
- build: Upgrade to Go 1.19 by @kyleconroy in #1780
- build: Upgrade to go-wasmtime 0.39.0 by @kyleconroy in #1781
- cmd(sqlc): Bump version to v1.15.0 by @kyleconroy in #1782
- docs: Add 1.15 changelog by @kyleconroy in #1783
New Contributors
- @hakobera made their first contribution in #1687
- @i6u made their first contribution in #1700
- @sbres made their first contribution in #1485
- @akutschera made their first contribution in #1729
- @javiercbk made their first contribution in #1693
- @Dexter2389 made their first contribution in #1764
- @SN9NV made their first contribution in #1772
- @jasonblanchard made their first contribution in #1775
Full Changelog: v1.14.0...v1.15.0
v1.14.0
What's Changed
- fix(bundler): Only close multipart writer once by @kyleconroy in #1528
- Adding LastInsertId for Go by @xeoncross in #1484
- build(deps): bump github.com/lib/pq from 1.10.4 to 1.10.5 by @dependabot in #1534
- build(deps): bump actions/setup-java from 2 to 3 by @dependabot in #1542
- build(deps): bump actions/setup-go from 2 to 3 by @dependabot in #1543
- build(deps): bump golang from 1.18.0 to 1.18.1 by @dependabot in #1547
- Added update query to postgresql docs by @airscholar in #1535
- feat: run sqlc with docker on windows cmd by @ParvinEyvazov in #1557
- Pydantic models config field by @danicc097 in #1538
- build(deps): bump github.com/jackc/pgx/v4 from 4.15.0 to 4.16.0 by @dependabot in #1562
- Prepend an underscore to a StructName if it starts with a digit. by @avalonbits in #1554
- fix typo in feature request bug template by @josharian in #1568
- feat: Add JSON "codegen" output by @kyleconroy in #1565
- build(deps): bump github.com/google/go-cmp from 0.5.7 to 0.5.8 by @dependabot in #1573
- UPDATED: sqlc.narg() - allow user-specified nullability by @skabbes in #1536
- docs: add documentation for sqlc.narg() by @skabbes in #1580
- docs: Add some more example code for running transactions by @Jille in #1583
- build(deps): bump github.com/jackc/pgx/v4 from 4.16.0 to 4.16.1 by @dependabot in #1597
- Add 1.13.0 to Issue Template by @danielbprice in #1592
- Add support for CHANGE COLUMN in MySQL by @dansimau in #1605
- build(deps): bump golang from 1.18.1 to 1.18.2 by @dependabot in #1609
- docs: fix examples by @orisano in #1608
- Fix panic when calling cmd.Do subsequently by @jlisthood in #1614
- build(deps): bump github.com/lib/pq from 1.10.5 to 1.10.6 by @dependabot in #1627
- doc: typo fix in overrides config example by @reddec in #1619
- [FIX] copyfrom imports by @positiveblue in #1626
- internal/codegen: add Enum.Valid and AllEnumValues by @josharian in #1613
- Refactor to Package Catalog to Improve Readability by @jakoguta in #1595
- Validate sqlc function arguments by @ryan-berger in #1633
- Bug fix to index relation creation bug by @jakoguta in #1640
- docs: Add documentation for version 2 of the configuration file by @kyleconroy in #1657
- build(deps): bump golang from 1.18.2 to 1.18.3 by @dependabot in #1658
- docs: Re-org the config page. Add JSON docs by @kyleconroy in #1659
- build(deps): bump actions/setup-python from 3 to 4 by @dependabot in #1666
- add support for custom Go struct tags by @josharian in #1569
- fix: fixed typo
sql.narg
in doc by @akhilmhdh in #1668 - feat: Process-based codegen plugins by @kyleconroy in #1578
- cmd/sqlc: Bump version to v1.14.0 by @kyleconroy in #1670
New Contributors
- @xeoncross made their first contribution in #1484
- @airscholar made their first contribution in #1535
- @ParvinEyvazov made their first contribution in #1557
- @danicc097 made their first contribution in #1538
- @avalonbits made their first contribution in #1554
- @josharian made their first contribution in #1568
- @skabbes made their first contribution in #1536
- @danielbprice made their first contribution in #1592
- @jlisthood made their first contribution in #1614
- @reddec made their first contribution in #1619
- @positiveblue made their first contribution in #1626
- @jakoguta made their first contribution in #1595
- @ryan-berger made their first contribution in #1633
- @akhilmhdh made their first contribution in #1668
Full Changelog: v1.13.0...v1.14.0
v1.13.0
What's Changed
- Define code generation interface via Protocol Buffers by @kyleconroy in #1406
- Refactor Kotlin codegen package to use plugin types by @kyleconroy in #1416
- fix(postgresql): Remove extra newline with db argument by @rliebz in #1417
- build(deps): bump github.com/jackc/pgx/v4 from 4.14.1 to 4.15.0 by @dependabot in #1421
- docs: Specify which db_type should be used in overrides by @egtann in #1427
- fix copyfrom methods on interface not matching generated methods by @alexdulin in #1424
- build(deps): bump golang from 1.17.6 to 1.17.7 by @dependabot in #1431
- docs: Add more documentation for go_type by @kyleconroy in #1432
- Start filling out SQLite support by @PadraigK in #1410
- Support codespace development by @kyleconroy in #1434
- chore: fix extra newline in comments for copyfrom by @alexdulin in #1438
- feat(pgx): Add support for batch operations by @jrperritt in #1437
- SQLite: Adds a few more tests, fixes DROP TABLE by @PadraigK in #1443
- Add support for delete statements by @PadraigK in #1447
- feat(sqlite) Adds support for column aliases and function arguments by @PadraigK in #1455
- feat(codegen): Insert comments in interfaces by @kyleconroy in #1458
- build(deps): bump actions/setup-python from 2 to 3 by @dependabot in #1461
- Refactor go codegen to plugin types by @stephen in #1460
- feat(sdk): Add the plugin SDK package by @kyleconroy in #1463
- build(deps): bump actions/checkout from 2.4.0 to 3 by @dependabot in #1464
- refactor(cmd): Simplify codegen selection logic by @kyleconroy in #1466
- chore: Generate marshal/unmarshal with vtprotobuf by @kyleconroy in #1467
- Remove data_type from column proto by @stephen in #1468
- docs: Add new logo by @kyleconroy in #1471
- docs: Add hosted services to privacy / data guide by @kyleconroy in #1475
- build(deps): bump golang from 1.17.7 to 1.17.8 by @dependabot in #1476
- docs: Add Plausible analytics by @kyleconroy in #1477
- build(deps): bump github.com/spf13/cobra from 1.3.0 to 1.4.0 by @dependabot in #1483
- fix(compiler): Fix left join nullability with table aliases by @timstudd in #1491
- build(endtoend): Don't run tests in testdata by @kyleconroy in #1492
- build(deps): bump golang from 1.17.8 to 1.18.0 by @dependabot in #1493
- feat: Upload projects by @kyleconroy in #1436
- Add a new issue template by @kyleconroy in #1497
- docs: Add more examples to updating rows by @kyleconroy in #1499
- config: Add basic fuzzing for config / overrides by @kyleconroy in #1500
- build(deps): bump google.golang.org/protobuf from 1.27.1 to 1.28.0 by @dependabot in #1504
- Added postgres CALL support by @terrycain in #1495
- Add version number to Python code comments by @kyleconroy in #1511
- feat: Add sqlc version to generated Kotlin code by @kyleconroy in #1512
- feat: Add sqlc version to generated Go code by @kyleconroy in #1513
- feat: Pass sqlc version in codegen request by @kyleconroy in #1514
- add materialized view support by @ludusrusso in #1509
- fix: Regenerate testdata for CREATE TABLE AS by @kyleconroy in #1516
- feat(python): Graduate Python support to beta by @kyleconroy in #1520
- docs: Include scope in changelog format by @kyleconroy in #1521
- release(cmd/sqlc): Bump to v1.13.0 by @kyleconroy in #1523
New Contributors
- @rliebz made their first contribution in #1417
- @alexdulin made their first contribution in #1424
- @jrperritt made their first contribution in #1437
- @stephen made their first contribution in #1460
- @terrycain made their first contribution in #1495
- @ludusrusso made their first contribution in #1509
Full Changelog: v1.12.0...v1.13.0
v1.12.0
What's Changed
- fix(sqlite): Update ANTLR v4 go.mod entry by @kyleconroy in #1336
- fix(compiler): Check delete statements for CTEs by @wabain in #1329
- First pass at AST-based codegen by @kyleconroy in #1333
- Postgres Inherits by @timwmillard in #1339
- chore(python): Add tests for :exec{result,rows} by @kyleconroy in #1344
- Generate queries class by @kyleconroy in #1338
- chore(python): Delete template-based codegen by @kyleconroy in #1345
- fix(compiler): Fix validation of GROUP BY on field aliases by @timstudd in #1348
- handling of dollar signs in function names by @Nlossae in #1359
- Add support for CREATE TABLE a ( LIKE b ) for Postgres by @Jille in #1355
- Update error message by @Threpio in #1366
- feat(postgres): Add support for sql.NullInt16 by @egtann in #1376
- Implement support for pgx's CopyFrom by @Jille in #1352
- Fixed typo in select.md by @Hirochon in #1378
- fix(copyfrom): Fix imports when non-copyfrom queries needed imports that copyfrom queries didn't by @Jille in #1386
- build: Format all Go code by @kyleconroy in #1387
- fix(postgresql): Remove extra comment newline by @kyleconroy in #1395
- Migrate SQLite Grammar to maintained version by @PadraigK in #1397
- Fix return type for subqueries in MySQL (#1383) by @dansimau in #1404
- fix: Enable strict function checking by @kyleconroy in #1405
- Bug: ALTER TABLE SET SCHEMA by @timwmillard in #1409
- cmd/sqlc: Bump version to v1.12.0 by @kyleconroy in #1415
New Contributors
- @Nlossae made their first contribution in #1359
- @Jille made their first contribution in #1355
- @Threpio made their first contribution in #1366
- @egtann made their first contribution in #1376
- @Hirochon made their first contribution in #1378
- @PadraigK made their first contribution in #1397
- @dansimau made their first contribution in #1404
Full Changelog: v1.11.0...v1.12.0
v1.11.0
Bug Fixes
- Update incorrect signatures (#1180)
- Correct aggregate func sig (#1182)
- Jsonb_build_object (#1211)
- Case-insensitive identifiers (#1216)
- Incorrect handling of meta (#1228)
- Detect invalid INSERT expression (#1231)
- Respect alias name for coalesce (#1232)
- Mark nullable when casting NULL (#1233)
- Support nullable fields in joins for MySQL engine (#1249)
- Fix between expression handling of table references (#1268)
- Support nullable fields in joins on same table (#1270)
- Fix missing binds in ORDER BY (#1273)
- Set RV for TargetList items on updates (#1252)
- Fix MySQL parser for query without trailing semicolon (#1282)
- Validate table alias references (#1283)
- Add support for MySQL ON DUPLICATE KEY UPDATE (#1286)
- Support references to columns in joined tables in UPDATE statements (#1289)
- Add validation for GROUP BY clause column references (#1285)
- Prevent variable redeclaration in single param conflict (#1298)
- Use common params struct field for same named params (#1296)
Documentation
- Replace deprecated go get with go install (#1181)
- Fix package name referenced in tutorial (#1202)
- Add environment variables (#1264)
- Add go.17+ install instructions (#1280)
- Warn about golang-migrate file order (#1302)
Features
Refactor
- Move from io/ioutil to io and os package (#1164)
Styling
- Apply gofmt to sample code (#1261)
New Contributors
- @Juneezee made their first contribution in #1164
- @ovadbar made their first contribution in #1072
- @l4u made their first contribution in #1199
- @oliverpool made their first contribution in #1204
- @cqsd made their first contribution in #1209
- @snakeclown made their first contribution in #1248
- @timstudd made their first contribution in #1249
- @orisano made their first contribution in #1261
- @andreasgan made their first contribution in #1252
- @lopezator made their first contribution in #1280
- @danielmmetz made their first contribution in #1279
- @wabain made their first contribution in #1301
- @remLse made their first contribution in #1302
Full Changelog: v1.10.0...v1.11.0