Skip to main content

durcno@1.0.0-alpha.21

Major Changes​

  • 6aab51d - Thanks to @almahdi404 !

    change(columns)!: change timestamp default and introduce timestamptz/timetz

    The timestamp column builder now defaults to timestamp without time zone instead 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: timestamptz and timetz​

    We added dedicated PostgreSQL column builders for timezone-aware SQL types:

    • timestamptz: maps to timestamp with time zone and is now the recommended choice for UTC-safe timestamps.
    • timetz: maps to time with time zone for timezone-aware time-of-day values.
    import { table, time, timestamp, timestamptz, timetz } from "durcno";

    export const Events = table("public", "events", {
    // New timezone-aware alias types
    createdAt: timestamptz({ notNull: true }),
    startTime: timetz({ notNull: true }),

    localDate: timestamp({}),
    localTime: time({}),
    });

    The CLI init template and related docs/tests were updated to prefer timestamptz for UTC-aware timestamps.

  • 3a254b9 - Thanks to @almahdi404 !

    change!: rename prequery to prepare

    The prequery function has been renamed to prepare to 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's doUpdateSet() methods to accept raw Sql instances for setting column values.
    • Enhanced update.set() to accept parameterized Arg values.
    • 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.

Patch Changes​

  • df393e7 - Thanks to @almahdi404 !

    refac(query-builders): standardize RETURNING clause rendering

    Extracted buildReturningClause helper into src/query-builders/helpers.ts to unify RETURNING clause SQL generation across InsertQuery, UpdateQuery, and DeleteQuery.

    This ensures consistent handling of "*" wildcard selection, explicit field inclusions ({ col: true }), and exclusion rules across all query builders.