- Add
pgtyped-rescript diagnosefor inspecting named SQL queries withdescribe,explain, andexplain analyze, including support for parameter JSON, parameter files, processed SQL output, query listing, JSON output, and statement timeouts. - Reduce default CLI generation output to only recompiled files, errors, and concise unchanged-run summaries; pass
--verboseto restore detailed per-file processing and skipped-file output.
- Gracefully skip optional AST-based query analysis when
pgsql-ast-parsercannot parse valid PostgreSQL syntax, so generation can continue with database-derived types.
- BREAKING: Require ReScript
>=12.0.0. - BREAKING: Remove the dependency on
@rescript/core. - BREAKING: Remove the dependency on
@rescript/tools; the CLI now uses the ReScript compiler toolchain from the installedrescriptpackage. - Fix
Pg.Pool.make(ConnectionString(...))so it creates a pool with{connectionString}instead of passing a raw string topg.Pool. - Fix
Pg.Client.releasebinding to returnunit, matchingnode-postgres. - Use
chokidarfor build-mode file matching so glob-stylesrcDirpatterns are handled consistently with watch mode. - Make sure
JSON.tis properly stringified so JSON arrays can be passed to params expectingJSON.twithout them being confused for regular Postgres arrays. - Auto-escape all ReScript keywords in generated record field names.
- Add automatic parsing of PostgreSQL check constraints to generate ReScript polyvariant types for enumeration-style constraints. Supports both
column IN (value1, value2, ...)andcolumn = ANY (ARRAY[value1, value2, ...])patterns with string and integer values. - Add top-level literal inference for SELECT queries. When a query returns literal values with aliases (e.g.
SELECT 'success' as status, 42 as code), PgTyped now automatically infers specific polyvariant types like[#"success"]and[#42]instead of genericstringandinttypes. This provides better type safety and autocompletion. Also works with UNION queries where literals are consistent across all branches. - Add support for PostgreSQL JSON population functions (
json_populate_record,json_populate_recordset,jsonb_populate_record,jsonb_populate_recordset,json_to_record,jsonb_to_recordset). This supports efficient bulk operations. - Use the
queryConfigAPI inpgtyped-rescript-runtime.
- Improve
pgbindings. - Upgrade
@rescript/coreto1.6.0.
- Autoinsert trailing commas in embedded SQL blocks.
- BREAKING CHANGE:
Null.tis no longer emitted, allnullvalues are autoconverted tooption. This gives a much more idiomatic ReScript experience. - Emit actually runnable query in module comment for each query, instead of the original non-valid SQL query.
- Relax requirement on providing query via
@namecomment. - Change
expectOneto panic if not finding a single item.
- Add mode for embedding
%sql(withone,expectOne,many, andexecuteflavors) in ReScript directly.
- Fix missing
rescript.jsonin published package.
- Fix type generation for arrays of types like
JSON.t. - BREAKING: Up required ReScript version to
>=11.1.0and@rescript/coreto>=1.3.0. - Proper
bigintsupport. - Emit
@gentypeannotations for everything. - Add each query to its own ReScript module, and emit helpers
many,one,expectOneandexecute.
- [CLI] bin is now named
pgtyped-rescriptso it won't clash with stockpgtyped.