durcno@1.0.0-alpha.21
Major Changes
-
6aab51d - Thanks to @almahdi404 !
change(columns)!: change timestamp default and introduce timestamptz/timetz
The
timestampcolumn builder now defaults totimestamp without time zoneinstead of opting into timezone-aware storage by default. This is a breaking change for projects that relied on the old behavior for UTC-aware timestamps.New builders:
timestamptzandtimetzWe added dedicated PostgreSQL column builders for timezone-aware SQL types:
timestamptz: maps totimestamp with time zoneand is now the recommended choice for UTC-safe timestamps.timetz: maps totime with time zonefor timezone-aware time-of-day values.
import { table, time, timestamp, timestamptz, timetz } from "durcno";export const Events = table("public", "events", {// New timezone-aware alias typescreatedAt: timestamptz({ notNull: true }),startTime: timetz({ notNull: true }),localDate: timestamp({}),localTime: time({}),});The CLI
inittemplate and related docs/tests were updated to prefertimestamptzfor UTC-aware timestamps. -
3a254b9 - Thanks to @almahdi404 !
change!: rename prequery to prepare
The
prequeryfunction has been renamed toprepareto better align with standard SQL terminology.
Minor Changes
-
30fd6c9 - Thanks to @almahdi404 !
impr(qb): support Sql and Arg in insert and update and type non-updateable columns
- Enhanced
update.set(),insert.values(), and conflict'sdoUpdateSet()methods to accept rawSqlinstances for setting column values. - Enhanced
update.set()to accept parameterizedArgvalues. - Strengthened TypeScript constraints for update and insert payloads. Columns that are strictly non-updateable (e.g., primary keys) or non-insertable (e.g.,
generatedAlways()) are now strictly excluded from the allowed object properties at compile-time, resulting in clearer TypeScript errors.
- Enhanced
Patch Changes
-
df393e7 - Thanks to @almahdi404 !
refac(query-builders): standardize RETURNING clause rendering
Extracted
buildReturningClausehelper intosrc/query-builders/helpers.tsto unifyRETURNINGclause SQL generation acrossInsertQuery,UpdateQuery, andDeleteQuery.This ensures consistent handling of
"*"wildcard selection, explicit field inclusions ({ col: true }), and exclusion rules across all query builders.