bun-query-builder 0.2.50 → 0.2.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@ export declare function canonicalStorageType(col: ColumnPlan, dialect: Supported
49
49
  * differently by a live DB vs a model (quoting, casts, `now()` vs
50
50
  * `CURRENT_TIMESTAMP`, `0` vs `'0'`) compare equal.
51
51
  */
52
- export declare function canonicalizeDefault(col: ColumnPlan): string | undefined;
52
+ export declare function canonicalizeDefault(col: ColumnPlan, dialect?: SupportedDialect): string | undefined;
53
53
  /**
54
54
  * Generate comprehensive SQL to migrate from a previous plan to a new plan,
55
55
  * plus a structured list of the operations involved (so callers can gate
@@ -83,6 +83,24 @@ export declare function generateDiffSql(previous: MigrationPlan | undefined, nex
83
83
  * are recorded, run once, and never removed.
84
84
  */
85
85
  export declare const GENERATED_MARKER: '-- qb:generated';
86
+ /**
87
+ * The database's own clock, in UTC, as a default.
88
+ *
89
+ * A managed `created_at` used to default to `CURRENT_TIMESTAMP`, which is the
90
+ * *session's local* wall clock on both Postgres and MySQL. On a host set to
91
+ * anything but UTC that writes digits that never happened in UTC, and every
92
+ * reader is out by the offset - it surfaced in ReviewOS as "7 hours ago" on a
93
+ * row written seconds earlier. The column type is not the bug and is unchanged:
94
+ * naive UTC is the convention, because MySQL has nothing equivalent to
95
+ * `timestamptz`.
96
+ *
97
+ * This is the marker, not the SQL. Each driver renders it in its own spelling,
98
+ * because there is no portable one: Postgres wants `(now() AT TIME ZONE 'utc')`,
99
+ * MySQL takes `UTC_TIMESTAMP` only inside brackets, and SQLite's
100
+ * `CURRENT_TIMESTAMP` is already UTC and is the only dialect that was right by
101
+ * accident.
102
+ */
103
+ export declare const UTC_CLOCK_DEFAULT: 'UTC_TIMESTAMP';
86
104
  export declare interface ColumnPlan {
87
105
  name: string
88
106
  type: NormalizedColumnType