@workflow/world-postgres 4.3.10 → 4.4.0

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.
package/README.md CHANGED
@@ -125,6 +125,11 @@ export WORKFLOW_POSTGRES_WORKER_CONCURRENCY="10"
125
125
 
126
126
  # Optional: Internal pg.Pool max size (default: 10)
127
127
  export WORKFLOW_POSTGRES_MAX_POOL_SIZE="10"
128
+
129
+ # Optional: Seconds a running delivery's job lock may go unrenewed before
130
+ # another process redelivers the job (default: 0, off; 30 is a good value
131
+ # when more than one process shares the database, see "Crash recovery")
132
+ export WORKFLOW_POSTGRES_JOB_LOCK_STALE_SECONDS="30"
128
133
  ```
129
134
 
130
135
  ### Programmatic Usage
@@ -145,18 +150,27 @@ const world = createWorld({
145
150
  // Or pass an existing pg.Pool (shared with your app Drizzle, etc.); `world.close()` will not end it.
146
151
  import { Pool } from "pg";
147
152
  const pool = new Pool({ connectionString: process.env.DATABASE_URL });
153
+ // The World leaves a pool you pass to you: listen for errors, or a connection
154
+ // the server ends (a restart, a failover, an idle timeout) ends the process.
155
+ pool.on("connect", (client) =>
156
+ client.on("error", (error) => console.error(error.message))
157
+ );
158
+ pool.on("error", () => {}); // An idle client's error, logged just above
148
159
  const worldFromPool = createWorld({ pool });
149
160
  ```
150
161
 
162
+ A connection the server ends emits an `'error'` event, and an `'error'` event with no listener ends the process. When `createWorld()` creates the pool, it listens on the pool and on every client it connects, and logs one `[world-postgres] Pooled PostgreSQL connection lost` line per lost connection. It doesn't add listeners to a pool you pass, so add both yourself, as above: pg-pool listens only on idle clients, and the World holds a checked-out client across a transaction's statements.
163
+
151
164
  ## Configuration Options
152
165
 
153
166
  | Option | Type | Default | Description |
154
167
  | ------------------ | --------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
155
168
  | `connectionString` | `string` | `process.env.WORKFLOW_POSTGRES_URL` or `'postgres://world:world@localhost:5432/world'` | Used only when `pool` is omitted, to construct an internal pool |
156
169
  | `maxPoolSize` | `number` | `process.env.WORKFLOW_POSTGRES_MAX_POOL_SIZE` or `pg.Pool` default (`10`) | Optional. Sets the internal `pg.Pool` max size when `createWorld()` creates the pool |
157
- | `pool` | `pg.Pool` | — | Optional. When set, used for Drizzle, Graphile Worker, and stream writes. `world.close()` does not end it. |
170
+ | `pool` | `pg.Pool` | — | Optional. When set, used for Drizzle, Graphile Worker, and stream writes. `world.close()` does not end it, and the World adds no `'error'` listeners to it (see above). |
158
171
  | `jobPrefix` | `string` | `process.env.WORKFLOW_POSTGRES_JOB_PREFIX` | Optional prefix for queue job names |
159
172
  | `queueConcurrency` | `number` | `10` | Number of concurrent active step executions per process |
173
+ | `jobLockStaleSeconds` | `number` | `process.env.WORKFLOW_POSTGRES_JOB_LOCK_STALE_SECONDS` or `0` (off) | Seconds a running delivery's job lock may go unrenewed before another process redelivers the job. `0` turns renewal and the release of stale locks off. `30` is a good value when more than one process shares the database. See [Crash recovery](#crash-recovery). |
160
174
 
161
175
  ## Environment Variables
162
176
 
@@ -167,6 +181,7 @@ const worldFromPool = createWorld({ pool });
167
181
  | `WORKFLOW_POSTGRES_JOB_PREFIX` | Prefix for queue job names | - |
168
182
  | `WORKFLOW_POSTGRES_WORKER_CONCURRENCY` | Number of concurrent workers | `10` |
169
183
  | `WORKFLOW_POSTGRES_MAX_POOL_SIZE` | Internal `pg.Pool` max size | `10` |
184
+ | `WORKFLOW_POSTGRES_JOB_LOCK_STALE_SECONDS` | Seconds a running delivery's job lock may go unrenewed before another process redelivers the job; `0` disables | `0` (off) |
170
185
 
171
186
  When `pool` is omitted, `maxPoolSize` precedence is: `createWorld({ maxPoolSize })`, then `WORKFLOW_POSTGRES_MAX_POOL_SIZE`, then the `pg.Pool` default.
172
187
 
@@ -223,6 +238,44 @@ import * as schema from '@workflow/world-postgres/schema';
223
238
 
224
239
  Make sure your PostgreSQL database is accessible and the user has sufficient permissions to create tables and manage jobs.
225
240
 
241
+ ### Timestamps and time zones
242
+
243
+ Every timestamp column is `timestamp with time zone`, so values are correct
244
+ whatever time zone the server or session runs in. Earlier versions used
245
+ `timestamp without time zone`: on a server outside UTC, `createdAt` came back
246
+ off by the server's UTC offset (for example 7 hours early on
247
+ `America/Los_Angeles`).
248
+
249
+ Migration 0027 converts the columns. On a server in UTC it only changes the
250
+ catalog; no table is rewritten. On a server in another time zone it also moves
251
+ the values that came from `now()` (every `created_at`, and `updated_at` on rows
252
+ never updated) from the server's local time to the instant they recorded. That
253
+ costs about one rewrite of each table (new row versions, WAL, and bloat until
254
+ vacuum), with the tables' locks held until it finishes, so plan a maintenance
255
+ window for a large database.
256
+
257
+ The migration waits at most 10 seconds for its locks (unless the session sets
258
+ its own `lock_timeout`), so a long-running transaction makes `bootstrap` fail
259
+ instead of queueing every query behind it. Run `bootstrap` again once that
260
+ transaction ends.
261
+
262
+ It assumes the `now()` values were written in the time zone of the session
263
+ that runs the migration. If your application's pool set a different session
264
+ time zone, set `workflow.legacy_timezone` to that zone for the migration. Use
265
+ `?options=-c%20workflow.legacy_timezone%3DEurope%2FBerlin` in the connection
266
+ string, or, where a pooler drops startup `options` (PgBouncer and several
267
+ hosted poolers), `ALTER DATABASE mydb SET workflow.legacy_timezone =
268
+ 'Europe/Berlin'` or `ALTER ROLE myuser SET ...` before running `bootstrap`.
269
+
270
+ On a server in UTC the upgrade order does not matter: the upgraded World reads
271
+ unconverted columns correctly in any Node.js time zone, and older versions read
272
+ converted ones correctly. On a server outside UTC, stop the previous version's
273
+ workers, run the migration, then start the upgraded app. Older versions read
274
+ the converted columns shifted by the server's UTC offset, which can skip or
275
+ stretch step retry backoffs. For the same reason there is no rolling back past
276
+ 0027 on such a server: the migration has no down step, and an older version
277
+ would read every converted value shifted.
278
+
226
279
  ## Features
227
280
 
228
281
  - **Durable Storage**: Stores workflow runs, events, steps, hooks, and webhooks in PostgreSQL
@@ -239,6 +292,7 @@ Make sure your PostgreSQL database is accessible and the user has sufficient per
239
292
  - Backlog stays in PostgreSQL when all execution slots are busy
240
293
  - Retry and sleep-style delays use Graphile `runAt` scheduling
241
294
  - Workflow and step execution is sent through `/.well-known/workflow/v1/flow` and `/.well-known/workflow/v1/step`
295
+ - With `jobLockStaleSeconds` set, a running delivery renews its job lock, and a job whose process died is redelivered by another process after `jobLockStaleSeconds` (see below)
242
296
 
243
297
  Deliveries for the same run may execute concurrently. A workflow request can
244
298
  execute a step inline and wait for a hook wake to abort that step, so the queue
@@ -247,6 +301,42 @@ in-flight and recently completed deliveries with the same idempotency key.
247
301
  Handlers must still tolerate at-least-once delivery across worker processes,
248
302
  restarts, or completed-message cache eviction.
249
303
 
304
+ ### Crash recovery
305
+
306
+ Graphile Worker on its own keeps a dead worker's job locked for 4 hours. By default (`jobLockStaleSeconds: 0`), a delivery whose process died mid-delivery is therefore recovered only by the next `start()`, which re-enqueues active runs, or after those 4 hours.
307
+
308
+ Set `jobLockStaleSeconds` (or `WORKFLOW_POSTGRES_JOB_LOCK_STALE_SECONDS`) to turn on lock renewal. A running delivery then renews its Graphile job lock every quarter of `jobLockStaleSeconds`, and at least every 10 seconds, and every process that runs workers releases this World's flow and step jobs whose locks have gone unrenewed for `jobLockStaleSeconds`. When a process dies mid-delivery, another process redelivers its jobs within about one and a half windows: about 45 seconds at 30. `30` is a good value when more than one process shares the database. The redelivery counts the attempt the dead process used.
309
+
310
+ Use the same value on every process that shares the database. Keep it well above the longest a process can go without running its timers (synchronous work that blocks the event loop) or getting a connection from its pool. A delivery whose renewals stall past the window is redelivered while it still runs, and the original delivery is not acknowledged when it finishes. Workflow and step handlers already tolerate that at-least-once delivery.
311
+
312
+ It's off by default because of rolling upgrades. Processes on an earlier version don't renew their locks, so an upgraded process would redeliver any of their deliveries that run longer than the window, and when the earlier-version process finishes such a delivery, its acknowledgement isn't fenced on the lock holder and can delete the redelivered job's row. So turn it on only once every process that shares the database runs a version that includes `jobLockStaleSeconds`, and set the same value on all of them.
313
+
314
+ ## Troubleshooting
315
+
316
+ ### A run stays `running` after a crash
317
+
318
+ Earlier versions wrote a step's `step_completed` or `step_failed` event
319
+ separately from the step row. A process that died between the two left the step
320
+ finished with no matching event, and the run never advanced. This query lists
321
+ those steps for runs still `running`:
322
+
323
+ ```sql
324
+ select s.run_id, s.step_id, s.step_name, s.status
325
+ from workflow.workflow_steps s
326
+ join workflow.workflow_runs r on r.id = s.run_id
327
+ where r.status = 'running'
328
+ and s.status in ('completed', 'failed')
329
+ and not exists (
330
+ select 1 from workflow.workflow_events e
331
+ where e.run_id = s.run_id
332
+ and e.correlation_id = s.step_id
333
+ and e.type = 'step_' || s.status
334
+ );
335
+ ```
336
+
337
+ Upgrading does not recover these runs. Cancel each one with
338
+ `workflow cancel <run-id>`.
339
+
250
340
  ## Development
251
341
 
252
342
  For local development, you can use the included Docker Compose configuration:
package/dist/config.d.ts CHANGED
@@ -16,6 +16,20 @@ export type PostgresWorldConfig = PgConnectionConfig & {
16
16
  */
17
17
  namespace?: string;
18
18
  queueConcurrency?: number;
19
+ /**
20
+ * Seconds a running delivery's Graphile job lock may go unrenewed before
21
+ * another process releases the job for redelivery. A delivery renews its
22
+ * lock while it runs, so this bounds how long a job whose process died stays
23
+ * locked. Use the same value on every process that shares the database, and
24
+ * keep it well above the longest time a process can go without running its
25
+ * timers (a blocked event loop) or getting a pool connection. `0` turns
26
+ * renewal and the release of stale locks off, which leaves recovery to
27
+ * Graphile Worker's fixed 4 hour reset and to restarts.
28
+ * Defaults to WORKFLOW_POSTGRES_JOB_LOCK_STALE_SECONDS, then `0` (off).
29
+ * 30 is a good value when more than one process shares the database; turn
30
+ * it on once every process runs a version that renews its locks.
31
+ */
32
+ jobLockStaleSeconds?: number;
19
33
  /**
20
34
  * Override the flush interval (in ms) for buffered stream writes.
21
35
  * Default is 10ms. Set to 0 for immediate flushing.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC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iBtcykgZm9yIGJ1ZmZlcmVkIHN0cmVhbSB3cml0ZXMuXG4gICAqIERlZmF1bHQgaXMgMTBtcy4gU2V0IHRvIDAgZm9yIGltbWVkaWF0ZSBmbHVzaGluZy5cbiAgICovXG4gIHN0cmVhbUZsdXNoSW50ZXJ2YWxNcz86IG51bWJlcjtcbn07XG4iXX0=
@@ -0,0 +1,23 @@
1
+ import type { Pool } from 'pg';
2
+ /**
3
+ * Keep a connection the server drops from ending the process.
4
+ *
5
+ * A restart or failover, `idle_session_timeout`, `pg_terminate_backend`, or a
6
+ * proxy closing idle sockets can end a connection at any time, and `pg`
7
+ * reports it as an `'error'` event on the client. pg-pool forwards an idle
8
+ * client's error to the pool, but detaches its own listener while a client is
9
+ * checked out, and Drizzle transactions and the invocation mailbox hold
10
+ * clients across statements. An `EventEmitter` with no `'error'` listener
11
+ * throws, so either case is an uncaught exception. Graphile Worker attaches
12
+ * listeners like these only while its runner is up, and a World that is only
13
+ * read from never starts one.
14
+ *
15
+ * Logging is all that is left to do: pg-pool discards a failed client when it
16
+ * is released, and a checked-out client's next query rejects, so its caller
17
+ * still sees the error.
18
+ *
19
+ * Only for a pool the World creates. A pool the caller passes in is theirs to
20
+ * listen on.
21
+ */
22
+ export declare function handleConnectionErrors(pool: Pool, isClosing: () => boolean): void;
23
+ //# sourceMappingURL=connection-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-errors.d.ts","sourceRoot":"","sources":["../src/connection-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,OAAO,GACvB,IAAI,CAuBN"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Keep a connection the server drops from ending the process.
3
+ *
4
+ * A restart or failover, `idle_session_timeout`, `pg_terminate_backend`, or a
5
+ * proxy closing idle sockets can end a connection at any time, and `pg`
6
+ * reports it as an `'error'` event on the client. pg-pool forwards an idle
7
+ * client's error to the pool, but detaches its own listener while a client is
8
+ * checked out, and Drizzle transactions and the invocation mailbox hold
9
+ * clients across statements. An `EventEmitter` with no `'error'` listener
10
+ * throws, so either case is an uncaught exception. Graphile Worker attaches
11
+ * listeners like these only while its runner is up, and a World that is only
12
+ * read from never starts one.
13
+ *
14
+ * Logging is all that is left to do: pg-pool discards a failed client when it
15
+ * is released, and a checked-out client's next query rejects, so its caller
16
+ * still sees the error.
17
+ *
18
+ * Only for a pool the World creates. A pool the caller passes in is theirs to
19
+ * listen on.
20
+ */
21
+ export function handleConnectionErrors(pool, isClosing) {
22
+ const log = (error) => {
23
+ // Expected while the World shuts its pool down.
24
+ if (isClosing())
25
+ return;
26
+ // Never the error itself: pg-pool sets `error.client`, whose connection
27
+ // parameters include the password.
28
+ console.warn(`[world-postgres] Pooled PostgreSQL connection lost${error.code ? ` (${error.code})` : ''}: ${error.message}`);
29
+ };
30
+ pool.on('connect', (client) => {
31
+ let lost = false;
32
+ client.on('error', (error) => {
33
+ // A client nobody has ended reports one drop twice: the server's error,
34
+ // then "Connection terminated unexpectedly" as the socket closes.
35
+ if (lost)
36
+ return;
37
+ lost = true;
38
+ log(error);
39
+ });
40
+ });
41
+ // pg-pool re-emits an idle client's error here after the listener above has
42
+ // logged it, so this one only keeps the pool from throwing.
43
+ pool.on('error', () => { });
44
+ }
45
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29ubmVjdGlvbi1lcnJvcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29ubmVjdGlvbi1lcnJvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FtQkc7QUFDSCxNQUFNLFVBQVUsc0JBQXNCLENBQ3BDLElBQVUsRUFD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udCBub2JvZHkgaGFzIGVuZGVkIHJlcG9ydHMgb25lIGRyb3AgdHdpY2U6IHRoZSBzZXJ2ZXIncyBlcnJvcixcbiAgICAgIC8vIHRoZW4gXCJDb25uZWN0aW9uIHRlcm1pbmF0ZWQgdW5leHBlY3RlZGx5XCIgYXMgdGhlIHNvY2tldCBjbG9zZXMuXG4gICAgICBpZiAobG9zdCkgcmV0dXJuO1xuICAgICAgbG9zdCA9IHRydWU7XG4gICAgICBsb2coZXJyb3IpO1xuICAgIH0pO1xuICB9KTtcbiAgLy8gcGctcG9vbCByZS1lbWl0cyBhbiBpZGxlIGNsaWVudCdzIGVycm9yIGhlcmUgYWZ0ZXIgdGhlIGxpc3RlbmVyIGFib3ZlIGhhc1xuICAvLyBsb2dnZWQgaXQsIHNvIHRoaXMgb25lIG9ubHkga2VlcHMgdGhlIHBvb2wgZnJvbSB0aHJvd2luZy5cbiAgcG9vbC5vbignZXJyb3InLCAoKSA9PiB7fSk7XG59XG4iXX0=
@@ -258,10 +258,10 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
258
258
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
259
259
  name: "created_at";
260
260
  tableName: "workflow_runs";
261
- dataType: "date";
262
- columnType: "PgTimestamp";
261
+ dataType: "custom";
262
+ columnType: "PgCustomColumn";
263
263
  data: Date;
264
- driverParam: string;
264
+ driverParam: string | Date;
265
265
  notNull: true;
266
266
  hasDefault: true;
267
267
  isPrimaryKey: false;
@@ -271,14 +271,16 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
271
271
  baseColumn: never;
272
272
  identity: undefined;
273
273
  generated: undefined;
274
- }, {}, {}>;
274
+ }, {}, {
275
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
276
+ }>;
275
277
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
276
278
  name: "updated_at";
277
279
  tableName: "workflow_runs";
278
- dataType: "date";
279
- columnType: "PgTimestamp";
280
+ dataType: "custom";
281
+ columnType: "PgCustomColumn";
280
282
  data: Date;
281
- driverParam: string;
283
+ driverParam: string | Date;
282
284
  notNull: true;
283
285
  hasDefault: true;
284
286
  isPrimaryKey: false;
@@ -288,14 +290,16 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
288
290
  baseColumn: never;
289
291
  identity: undefined;
290
292
  generated: undefined;
291
- }, {}, {}>;
293
+ }, {}, {
294
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
295
+ }>;
292
296
  completedAt: import("drizzle-orm/pg-core").PgColumn<{
293
297
  name: "completed_at";
294
298
  tableName: "workflow_runs";
295
- dataType: "date";
296
- columnType: "PgTimestamp";
299
+ dataType: "custom";
300
+ columnType: "PgCustomColumn";
297
301
  data: Date;
298
- driverParam: string;
302
+ driverParam: string | Date;
299
303
  notNull: false;
300
304
  hasDefault: false;
301
305
  isPrimaryKey: false;
@@ -305,14 +309,16 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
305
309
  baseColumn: never;
306
310
  identity: undefined;
307
311
  generated: undefined;
308
- }, {}, {}>;
312
+ }, {}, {
313
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
314
+ }>;
309
315
  startedAt: import("drizzle-orm/pg-core").PgColumn<{
310
316
  name: "started_at";
311
317
  tableName: "workflow_runs";
312
- dataType: "date";
313
- columnType: "PgTimestamp";
318
+ dataType: "custom";
319
+ columnType: "PgCustomColumn";
314
320
  data: Date;
315
- driverParam: string;
321
+ driverParam: string | Date;
316
322
  notNull: false;
317
323
  hasDefault: false;
318
324
  isPrimaryKey: false;
@@ -322,14 +328,16 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
322
328
  baseColumn: never;
323
329
  identity: undefined;
324
330
  generated: undefined;
325
- }, {}, {}>;
331
+ }, {}, {
332
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
333
+ }>;
326
334
  expiredAt: import("drizzle-orm/pg-core").PgColumn<{
327
335
  name: "expired_at";
328
336
  tableName: "workflow_runs";
329
- dataType: "date";
330
- columnType: "PgTimestamp";
337
+ dataType: "custom";
338
+ columnType: "PgCustomColumn";
331
339
  data: Date;
332
- driverParam: string;
340
+ driverParam: string | Date;
333
341
  notNull: false;
334
342
  hasDefault: false;
335
343
  isPrimaryKey: false;
@@ -339,7 +347,9 @@ export declare const runs: import("drizzle-orm/pg-core").PgTableWithColumns<{
339
347
  baseColumn: never;
340
348
  identity: undefined;
341
349
  generated: undefined;
342
- }, {}, {}>;
350
+ }, {}, {
351
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
352
+ }>;
343
353
  };
344
354
  dialect: "pg";
345
355
  }>;
@@ -408,10 +418,10 @@ export declare const events: import("drizzle-orm/pg-core").PgTableWithColumns<{
408
418
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
409
419
  name: "created_at";
410
420
  tableName: "workflow_events";
411
- dataType: "date";
412
- columnType: "PgTimestamp";
421
+ dataType: "custom";
422
+ columnType: "PgCustomColumn";
413
423
  data: Date;
414
- driverParam: string;
424
+ driverParam: string | Date;
415
425
  notNull: true;
416
426
  hasDefault: true;
417
427
  isPrimaryKey: false;
@@ -421,7 +431,9 @@ export declare const events: import("drizzle-orm/pg-core").PgTableWithColumns<{
421
431
  baseColumn: never;
422
432
  identity: undefined;
423
433
  generated: undefined;
424
- }, {}, {}>;
434
+ }, {}, {
435
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
436
+ }>;
425
437
  runId: import("drizzle-orm/pg-core").PgColumn<{
426
438
  name: "run_id";
427
439
  tableName: "workflow_events";
@@ -711,10 +723,10 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
711
723
  startedAt: import("drizzle-orm/pg-core").PgColumn<{
712
724
  name: "started_at";
713
725
  tableName: "workflow_steps";
714
- dataType: "date";
715
- columnType: "PgTimestamp";
726
+ dataType: "custom";
727
+ columnType: "PgCustomColumn";
716
728
  data: Date;
717
- driverParam: string;
729
+ driverParam: string | Date;
718
730
  notNull: false;
719
731
  hasDefault: false;
720
732
  isPrimaryKey: false;
@@ -724,14 +736,16 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
724
736
  baseColumn: never;
725
737
  identity: undefined;
726
738
  generated: undefined;
727
- }, {}, {}>;
739
+ }, {}, {
740
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
741
+ }>;
728
742
  completedAt: import("drizzle-orm/pg-core").PgColumn<{
729
743
  name: "completed_at";
730
744
  tableName: "workflow_steps";
731
- dataType: "date";
732
- columnType: "PgTimestamp";
745
+ dataType: "custom";
746
+ columnType: "PgCustomColumn";
733
747
  data: Date;
734
- driverParam: string;
748
+ driverParam: string | Date;
735
749
  notNull: false;
736
750
  hasDefault: false;
737
751
  isPrimaryKey: false;
@@ -741,14 +755,16 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
741
755
  baseColumn: never;
742
756
  identity: undefined;
743
757
  generated: undefined;
744
- }, {}, {}>;
758
+ }, {}, {
759
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
760
+ }>;
745
761
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
746
762
  name: "created_at";
747
763
  tableName: "workflow_steps";
748
- dataType: "date";
749
- columnType: "PgTimestamp";
764
+ dataType: "custom";
765
+ columnType: "PgCustomColumn";
750
766
  data: Date;
751
- driverParam: string;
767
+ driverParam: string | Date;
752
768
  notNull: true;
753
769
  hasDefault: true;
754
770
  isPrimaryKey: false;
@@ -758,14 +774,16 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
758
774
  baseColumn: never;
759
775
  identity: undefined;
760
776
  generated: undefined;
761
- }, {}, {}>;
777
+ }, {}, {
778
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
779
+ }>;
762
780
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
763
781
  name: "updated_at";
764
782
  tableName: "workflow_steps";
765
- dataType: "date";
766
- columnType: "PgTimestamp";
783
+ dataType: "custom";
784
+ columnType: "PgCustomColumn";
767
785
  data: Date;
768
- driverParam: string;
786
+ driverParam: string | Date;
769
787
  notNull: true;
770
788
  hasDefault: true;
771
789
  isPrimaryKey: false;
@@ -775,14 +793,16 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
775
793
  baseColumn: never;
776
794
  identity: undefined;
777
795
  generated: undefined;
778
- }, {}, {}>;
796
+ }, {}, {
797
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
798
+ }>;
779
799
  retryAfter: import("drizzle-orm/pg-core").PgColumn<{
780
800
  name: "retry_after";
781
801
  tableName: "workflow_steps";
782
- dataType: "date";
783
- columnType: "PgTimestamp";
802
+ dataType: "custom";
803
+ columnType: "PgCustomColumn";
784
804
  data: Date;
785
- driverParam: string;
805
+ driverParam: string | Date;
786
806
  notNull: false;
787
807
  hasDefault: false;
788
808
  isPrimaryKey: false;
@@ -792,7 +812,9 @@ export declare const steps: import("drizzle-orm/pg-core").PgTableWithColumns<{
792
812
  baseColumn: never;
793
813
  identity: undefined;
794
814
  generated: undefined;
795
- }, {}, {}>;
815
+ }, {}, {
816
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
817
+ }>;
796
818
  specVersion: import("drizzle-orm/pg-core").PgColumn<{
797
819
  name: "spec_version";
798
820
  tableName: "workflow_steps";
@@ -934,10 +956,10 @@ export declare const hooks: import("drizzle-orm/pg-core").PgTableWithColumns<{
934
956
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
935
957
  name: "created_at";
936
958
  tableName: "workflow_hooks";
937
- dataType: "date";
938
- columnType: "PgTimestamp";
959
+ dataType: "custom";
960
+ columnType: "PgCustomColumn";
939
961
  data: Date;
940
- driverParam: string;
962
+ driverParam: string | Date;
941
963
  notNull: true;
942
964
  hasDefault: true;
943
965
  isPrimaryKey: false;
@@ -947,7 +969,9 @@ export declare const hooks: import("drizzle-orm/pg-core").PgTableWithColumns<{
947
969
  baseColumn: never;
948
970
  identity: undefined;
949
971
  generated: undefined;
950
- }, {}, {}>;
972
+ }, {}, {
973
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
974
+ }>;
951
975
  metadataJson: import("drizzle-orm/pg-core").PgColumn<{
952
976
  name: "metadata";
953
977
  tableName: "workflow_hooks";
@@ -1085,10 +1109,10 @@ export declare const waits: import("drizzle-orm/pg-core").PgTableWithColumns<{
1085
1109
  resumeAt: import("drizzle-orm/pg-core").PgColumn<{
1086
1110
  name: "resume_at";
1087
1111
  tableName: "workflow_waits";
1088
- dataType: "date";
1089
- columnType: "PgTimestamp";
1112
+ dataType: "custom";
1113
+ columnType: "PgCustomColumn";
1090
1114
  data: Date;
1091
- driverParam: string;
1115
+ driverParam: string | Date;
1092
1116
  notNull: false;
1093
1117
  hasDefault: false;
1094
1118
  isPrimaryKey: false;
@@ -1098,14 +1122,16 @@ export declare const waits: import("drizzle-orm/pg-core").PgTableWithColumns<{
1098
1122
  baseColumn: never;
1099
1123
  identity: undefined;
1100
1124
  generated: undefined;
1101
- }, {}, {}>;
1125
+ }, {}, {
1126
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
1127
+ }>;
1102
1128
  completedAt: import("drizzle-orm/pg-core").PgColumn<{
1103
1129
  name: "completed_at";
1104
1130
  tableName: "workflow_waits";
1105
- dataType: "date";
1106
- columnType: "PgTimestamp";
1131
+ dataType: "custom";
1132
+ columnType: "PgCustomColumn";
1107
1133
  data: Date;
1108
- driverParam: string;
1134
+ driverParam: string | Date;
1109
1135
  notNull: false;
1110
1136
  hasDefault: false;
1111
1137
  isPrimaryKey: false;
@@ -1115,14 +1141,16 @@ export declare const waits: import("drizzle-orm/pg-core").PgTableWithColumns<{
1115
1141
  baseColumn: never;
1116
1142
  identity: undefined;
1117
1143
  generated: undefined;
1118
- }, {}, {}>;
1144
+ }, {}, {
1145
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
1146
+ }>;
1119
1147
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
1120
1148
  name: "created_at";
1121
1149
  tableName: "workflow_waits";
1122
- dataType: "date";
1123
- columnType: "PgTimestamp";
1150
+ dataType: "custom";
1151
+ columnType: "PgCustomColumn";
1124
1152
  data: Date;
1125
- driverParam: string;
1153
+ driverParam: string | Date;
1126
1154
  notNull: true;
1127
1155
  hasDefault: true;
1128
1156
  isPrimaryKey: false;
@@ -1132,14 +1160,16 @@ export declare const waits: import("drizzle-orm/pg-core").PgTableWithColumns<{
1132
1160
  baseColumn: never;
1133
1161
  identity: undefined;
1134
1162
  generated: undefined;
1135
- }, {}, {}>;
1163
+ }, {}, {
1164
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
1165
+ }>;
1136
1166
  updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1137
1167
  name: "updated_at";
1138
1168
  tableName: "workflow_waits";
1139
- dataType: "date";
1140
- columnType: "PgTimestamp";
1169
+ dataType: "custom";
1170
+ columnType: "PgCustomColumn";
1141
1171
  data: Date;
1142
- driverParam: string;
1172
+ driverParam: string | Date;
1143
1173
  notNull: true;
1144
1174
  hasDefault: true;
1145
1175
  isPrimaryKey: false;
@@ -1149,7 +1179,9 @@ export declare const waits: import("drizzle-orm/pg-core").PgTableWithColumns<{
1149
1179
  baseColumn: never;
1150
1180
  identity: undefined;
1151
1181
  generated: undefined;
1152
- }, {}, {}>;
1182
+ }, {}, {
1183
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
1184
+ }>;
1153
1185
  specVersion: import("drizzle-orm/pg-core").PgColumn<{
1154
1186
  name: "spec_version";
1155
1187
  tableName: "workflow_waits";
@@ -1254,10 +1286,10 @@ export declare const streams: import("drizzle-orm/pg-core").PgTableWithColumns<{
1254
1286
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
1255
1287
  name: "created_at";
1256
1288
  tableName: "workflow_stream_chunks";
1257
- dataType: "date";
1258
- columnType: "PgTimestamp";
1289
+ dataType: "custom";
1290
+ columnType: "PgCustomColumn";
1259
1291
  data: Date;
1260
- driverParam: string;
1292
+ driverParam: string | Date;
1261
1293
  notNull: true;
1262
1294
  hasDefault: true;
1263
1295
  isPrimaryKey: false;
@@ -1267,7 +1299,9 @@ export declare const streams: import("drizzle-orm/pg-core").PgTableWithColumns<{
1267
1299
  baseColumn: never;
1268
1300
  identity: undefined;
1269
1301
  generated: undefined;
1270
- }, {}, {}>;
1302
+ }, {}, {
1303
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
1304
+ }>;
1271
1305
  eof: import("drizzle-orm/pg-core").PgColumn<{
1272
1306
  name: "eof";
1273
1307
  tableName: "workflow_stream_chunks";
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/drizzle/schema.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,MAAM,oDAAuB,CAAC;AAM3C,eAAO,MAAM,iBAAiB,2KAG7B,CAAC;AAEF,eAAO,MAAM,UAAU,2KAGtB,CAAC;AAEF,eAAO,MAAM,UAAU,iGAGtB,CAAC;AAYF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC;AAEtC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoChB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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