Register the shared pg type-parser overrides on the module-global pg.types.
Dynamically imports the pg runtime (so pglite-only consumers, who never
call this, don't need pg installed) and coerces int8 (BIGINT, OID 20)
to a JS number. pg defaults to returning
int8 as a string to avoid 2^53 precision loss; our int8 columns today
(audit_log.seq, cell_history.id, fact.size) stay well under that
bound, and reading as a number keeps the wire shape uniform with PGlite —
which returns int8 as a number — so AuditLogEvent.seq and friends
validate identically across both drivers.
Both create_db (production) and the test pg factory (testing/db.ts)
register through this single site so test and prod read the same shape; a
divergence here is exactly the test/prod write-semantics gap the parser
exists to close.
CAVEAT: setTypeParser mutates pg.types globally — every pg.Pool in
the process inherits the coercion, including pools the consumer constructs
against unrelated databases. Any future int8 column that could legitimately
exceed 2^53 (byte offsets, counters) will silently round; if one lands,
localize via a per-pool types override instead of widening this global.