Repository navigation
v0.36.0
Removed
sqlode/runtimekeeps only what generated code and a custom adapter use:prepare,nullable, and the typesRawQuery,QueryInfo,QueryCommand,ValueandPlaceholderStyle. The value helpersnull,string,int,float,bool,bytesandarrayare gone; use theValueconstructors, which are functions too. Theraw_query*builders are gone; buildRawQuery(...)directly.ExpandError,MarkerError,expand_slice_placeholders,expand_slice_placeholders_checked,param_marker_checkedandslice_marker_checkedare gone, andparam_marker,slice_markerandrender_placeholderare internal.QueryCommandlostBatchOne,BatchMany,BatchExecandCopyFrom, which no generated query could have. Regenerate your code with this version; hand-written code that called the helpers changes like this:
// before
runtime.nullable(p.bio, runtime.string)
runtime.int(p.id)
// after
runtime.nullable(p.bio, runtime.String)
runtime.Int(p.id)Fixed
- String prefixes (
X'',E'',U&'',B'',N'') and doubled quotes inside quoted identifiers reach the generated SQL unchanged. A SQLiteX'DEADBEEF'used to become the text'DEADBEEF'. - Schema and query files with CRLF line endings read the same as LF. Unicode spaces and a leading BOM are whitespace.
- A
CREATE TABLEcolumn list ends at its closing parenthesis, soPARTITION BY HASH (a, b)and MySQL partition clauses no longer add columns. - Backslash escapes in MySQL strings and PostgreSQL
E''strings are part of the string, so'it\'s' AND id = ?keeps its parameter. Thesqlode.slicecheck reads the SQL with the block's engine for the same reason. - Enum values with
-, spaces or quotes produce valid constructors and string literals. A value that still cannot become a Gleam constructor stops generation with SQD2006. generateexits 1 whengleam formatreports a syntax error in the generated files.- Macro names and the
TYPEkeyword match in any letter case. sqlc.argand the othersqlc.*macros stop generation with SQD3009 instead of passing through as SQL with no parameters.- Non-ASCII identifiers are read as one word. A name that cannot become a Gleam name stops generation with SQD5005.
- An
outpath that would put..in the import path stops with SQD5002 instead of generating an invalid import. verifyreports SQD2006 and SQD5005 asgeneratedoes, and prints each warning once.
Changed
- The guides now live on HexDocs: configuration, capabilities and errors. The tutorial, the sqlc migration notes and the custom adapter pages were folded into the README and the
sqlode/runtimedocs.
Install
Download the sqlode escript below and place it on your PATH.
Requires Erlang/OTP runtime.
chmod +x sqlode
./sqlode generate --config=sqlode.yamlSHA256SUMS is signed with cosign (SHA256SUMS.sigstore.json), and SLSA provenance is attached. See "Verifying release integrity" in the README.