mirror of
https://github.com/hanzoai/orm.git
synced 2026-10-30 15:01:22 +00:00
Typed[T].Count swapped the projection for COUNT(*) and kept every other
clause. SQLite accepted the ORDER BY left beside the aggregate; PostgreSQL
refuses it ("must appear in the GROUP BY clause"), so every ordered Count
failed on hanzo-sql alone. A grouped query answered one group's count, and
LIMIT and DISTINCT were ignored on both. Count now runs the query itself as
a subquery of SELECT COUNT(*), with the order dropped.
It was found by running the relational tests on PostgreSQL, which they now
do on every run: internal/pgtest starts a throwaway server from the
binaries on the machine, on a Unix socket in a temporary directory, and a
machine without one says so by name.
replicated/go.mod was untidy against the root module, which failed its
build gate on main.
Co-authored-by: Hanzo Dev <[email protected]>