mirror of
https://github.com/hanzoai/orm.git
synced 2026-10-30 15:01:22 +00:00
A value is compared the same way on both engines only if the engine is asked
how to spell it. Three spellings were being written as SQLite's:
Like — only SQLite's LIKE folds case, so Postgres needs ILIKE. Not the
nocase collation, which PG17 refuses for LIKE outright.
Bool — 1 and 0 are not booleans outside SQLite. Quoted on Postgres, so one
literal reads as a boolean beside a boolean column and as text
beside a value read out of a JSON document.
Number — a value read out of a JSON document is text wherever columns are
typed. The cast is guarded, so a value that is not a numeral fails
to match rather than raising: SQLite answers "no match" for the same
data, and an engine difference should not become an error.
Co-authored-by: Hanzo Dev <[email protected]>