durcno@1.0.0-alpha.6
Minor Changes
-
daff8b6 - Thanks to @almahdi404 !
impr(columns)!: map bigint and bigserial to JS bigint
The
bigintandbigserialcolumn types now map to JavaScript's nativebigintinstead ofnumber.PostgreSQL's 64-bit integer (
bigint) can exceedNumber.MAX_SAFE_INTEGER(2^53 - 1), makingnumberan unsafe representation. Usingbigintensures full precision for all values.Breaking change for
bigintandbigserialcolumns: values read from the database and values passed in queries/filters must now usebigintliterals (e.g.1ninstead of1).// Beforeawait db.from(Users).select().where(eq(Users.id, 1));// Afterawait db.from(Users).select().where(eq(Users.id, 1n));The Zod validator for these columns has also been updated to use
z.coerce.bigint().
Patch Changes
-
d62d5fd - Thanks to @almahdi404 !
perf(filters): remove toSQL in favor of direct query mutation
All filter classes previously implemented both
toSQL(): stringandtoQuery(query: Query): void. Query builders conditionally called one or the other depending on whether a prepared statement was being built, creating redundant string allocations.The
toSQL()method has been removed from every filter class (EqualValCondition,InCondition,AndCondition,OrCondition, array filters, etc.) and from the abstractFilterbase class. Query builders now calltoQuery()unconditionally, appending directly toquery.sqlvia+=without intermediate string returns or joins.This eliminates unnecessary string concatenation overhead and reduces the number of code paths that had to be maintained in sync.