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

  1. Find affected functions: Regenerate your schema and compare to previous version:

    squealgen mydb Schema public > Schema.hs.new
    diff Schema.hs Schema.hs.new
    
  2. 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/
  3. No action needed if:

    • The function is not overloaded in PostgreSQL
    • Only one overload is representable (compatibility alias preserved)

Other Changes

Unreleased changes