Changelog for squealgen-0.2.0.0
Changelog for squealgen
0.2.0.0 (2026-02-16)
Breaking Changes
Overloaded function naming now uses disambiguated labels.
Previously, when a PostgreSQL function was overloaded, squealgen would emit only one overload (undefined which one). Now, all representable overloads are emitted with disambiguated labels.
Function label format: name__argtype1__argtype2
Example for my_func(int4) and my_func(int8):
type Functions =
'[ "my_func__int4" ::: Function '[Null PGint4] :=> 'Returns ('Null PGint4)
, "my_func__int8" ::: Function '[Null PGint8] :=> 'Returns ('Null PGint8)
]
Compatibility aliases are emitted when exactly one overload is representable (others have pseudotype arguments). For example, if legacy_func(int8) is representable but legacy_func(anyelement) is not:
type Functions =
'[ "legacy_func" ::: Function '[Null PGint8] :=> ... -- compatibility alias
, "legacy_func__int8" ::: Function '[Null PGint8] :=> ... -- disambiguated label
]
Migration Guide
-
Find affected functions: Regenerate your schema and compare to previous version:
squealgen mydb Schema public > Schema.hs.new diff Schema.hs Schema.hs.new -
Update call sites: Replace simple function names with disambiguated labels:
- Before:
#"my_func"→ After:#"my_func__int8"(or appropriate type suffix) - Use grep to find usages:
grep -r '#"my_func"' src/
- Before:
-
No action needed if:
- The function is not overloaded in PostgreSQL
- Only one overload is representable (compatibility alias preserved)
Other Changes
- Generator hardening:
chosen_schemais treated as a comma-separatedsearch_pathfragment and applied safely (quoted identifiers, no raw psql substitution).- The generated
type DBtargets the first schema in the fragment. - Views list output is deterministic (explicit ordering inside
string_agg).
- Extensions:
- Extension-owned types are emitted as
UnsafePGTypealiases only when referenced. - Generated output includes a comment block listing detected required extensions when extension-owned types are present.
- Added an end-to-end
ltreefixture (test/Extensions) and CI installspostgresql-contrib.
- Extension-owned types are emitted as
- CI/testing:
- Dropped the coverage gate (coverage is not meaningful for this generator-only repo).
make cirunscabal testwith reduced falsify cases (--falsify-tests 25) to keep CI runtime bounded.
Unreleased changes
- Generator hardening:
chosen_schemais treated as a comma-separatedsearch_pathfragment and applied safely (quoted identifiers, no raw psql substitution).- The generated
type DBtargets the first schema in the fragment. - Views list output is deterministic (explicit ordering inside
string_agg).
- Extensions:
- Extension-owned types are emitted as
UnsafePGTypealiases only when referenced. - Generated output includes a comment block listing detected required extensions when extension-owned types are present.
- Added an end-to-end
ltreefixture (test/Extensions) and CI installspostgresql-contrib.
- Extension-owned types are emitted as
- CI/testing:
- Dropped the coverage gate (coverage is not meaningful for this generator-only repo).
make cirunscabal testwith reduced falsify cases (--falsify-tests 25) to keep CI runtime bounded.