@pgflow/core 0.0.0-test-snapshot-releases-8d5d9bc1-20250922101013 → 0.0.0-testsnap-9294d743-20251207205914

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.
Files changed (32) hide show
  1. package/README.md +177 -73
  2. package/dist/ATLAS.md +32 -0
  3. package/dist/CHANGELOG.md +824 -0
  4. package/dist/PgflowSqlClient.d.ts +17 -0
  5. package/dist/PgflowSqlClient.d.ts.map +1 -0
  6. package/dist/PgflowSqlClient.js +70 -0
  7. package/dist/README.md +497 -0
  8. package/dist/database-types.d.ts +1041 -0
  9. package/dist/database-types.d.ts.map +1 -0
  10. package/dist/database-types.js +8 -0
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +2 -0
  14. package/dist/package.json +31 -0
  15. package/dist/supabase/migrations/20250429164909_pgflow_initial.sql +579 -0
  16. package/dist/supabase/migrations/20250517072017_pgflow_fix_poll_for_tasks_to_use_separate_statement_for_polling.sql +101 -0
  17. package/dist/supabase/migrations/20250609105135_pgflow_add_start_tasks_and_started_status.sql +371 -0
  18. package/dist/supabase/migrations/20250610180554_pgflow_add_set_vt_batch_and_use_it_in_start_tasks.sql +127 -0
  19. package/dist/supabase/migrations/20250614124241_pgflow_add_realtime.sql +501 -0
  20. package/dist/supabase/migrations/20250619195327_pgflow_fix_fail_task_missing_realtime_event.sql +185 -0
  21. package/dist/supabase/migrations/20250627090700_pgflow_fix_function_search_paths.sql +6 -0
  22. package/dist/supabase/migrations/20250707210212_pgflow_add_opt_start_delay.sql +103 -0
  23. package/dist/supabase/migrations/20250719205006_pgflow_worker_deprecation.sql +2 -0
  24. package/dist/supabase/migrations/20251006073122_pgflow_add_map_step_type.sql +1244 -0
  25. package/dist/supabase/migrations/20251103222045_pgflow_fix_broadcast_order_and_timestamp_handling.sql +622 -0
  26. package/dist/supabase/migrations/20251104080523_pgflow_upgrade_pgmq_1_5_1.sql +93 -0
  27. package/dist/supabase/migrations/20251130000000_pgflow_auto_compilation.sql +268 -0
  28. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  29. package/dist/types.d.ts +93 -0
  30. package/dist/types.d.ts.map +1 -0
  31. package/dist/types.js +1 -0
  32. package/package.json +4 -5
@@ -0,0 +1,1041 @@
1
+ export type Json = string | number | boolean | null | {
2
+ [key: string]: Json | undefined;
3
+ } | Json[];
4
+ export type Database = {
5
+ pgflow: {
6
+ Tables: {
7
+ deps: {
8
+ Row: {
9
+ created_at: string;
10
+ dep_slug: string;
11
+ flow_slug: string;
12
+ step_slug: string;
13
+ };
14
+ Insert: {
15
+ created_at?: string;
16
+ dep_slug: string;
17
+ flow_slug: string;
18
+ step_slug: string;
19
+ };
20
+ Update: {
21
+ created_at?: string;
22
+ dep_slug?: string;
23
+ flow_slug?: string;
24
+ step_slug?: string;
25
+ };
26
+ Relationships: [
27
+ {
28
+ foreignKeyName: "deps_flow_slug_dep_slug_fkey";
29
+ columns: ["flow_slug", "dep_slug"];
30
+ isOneToOne: false;
31
+ referencedRelation: "steps";
32
+ referencedColumns: ["flow_slug", "step_slug"];
33
+ },
34
+ {
35
+ foreignKeyName: "deps_flow_slug_fkey";
36
+ columns: ["flow_slug"];
37
+ isOneToOne: false;
38
+ referencedRelation: "flows";
39
+ referencedColumns: ["flow_slug"];
40
+ },
41
+ {
42
+ foreignKeyName: "deps_flow_slug_step_slug_fkey";
43
+ columns: ["flow_slug", "step_slug"];
44
+ isOneToOne: false;
45
+ referencedRelation: "steps";
46
+ referencedColumns: ["flow_slug", "step_slug"];
47
+ }
48
+ ];
49
+ };
50
+ flows: {
51
+ Row: {
52
+ created_at: string;
53
+ flow_slug: string;
54
+ opt_base_delay: number;
55
+ opt_max_attempts: number;
56
+ opt_timeout: number;
57
+ };
58
+ Insert: {
59
+ created_at?: string;
60
+ flow_slug: string;
61
+ opt_base_delay?: number;
62
+ opt_max_attempts?: number;
63
+ opt_timeout?: number;
64
+ };
65
+ Update: {
66
+ created_at?: string;
67
+ flow_slug?: string;
68
+ opt_base_delay?: number;
69
+ opt_max_attempts?: number;
70
+ opt_timeout?: number;
71
+ };
72
+ Relationships: [];
73
+ };
74
+ runs: {
75
+ Row: {
76
+ completed_at: string | null;
77
+ failed_at: string | null;
78
+ flow_slug: string;
79
+ input: Json;
80
+ output: Json | null;
81
+ remaining_steps: number;
82
+ run_id: string;
83
+ started_at: string;
84
+ status: string;
85
+ };
86
+ Insert: {
87
+ completed_at?: string | null;
88
+ failed_at?: string | null;
89
+ flow_slug: string;
90
+ input: Json;
91
+ output?: Json | null;
92
+ remaining_steps?: number;
93
+ run_id?: string;
94
+ started_at?: string;
95
+ status?: string;
96
+ };
97
+ Update: {
98
+ completed_at?: string | null;
99
+ failed_at?: string | null;
100
+ flow_slug?: string;
101
+ input?: Json;
102
+ output?: Json | null;
103
+ remaining_steps?: number;
104
+ run_id?: string;
105
+ started_at?: string;
106
+ status?: string;
107
+ };
108
+ Relationships: [
109
+ {
110
+ foreignKeyName: "runs_flow_slug_fkey";
111
+ columns: ["flow_slug"];
112
+ isOneToOne: false;
113
+ referencedRelation: "flows";
114
+ referencedColumns: ["flow_slug"];
115
+ }
116
+ ];
117
+ };
118
+ step_states: {
119
+ Row: {
120
+ completed_at: string | null;
121
+ created_at: string;
122
+ error_message: string | null;
123
+ failed_at: string | null;
124
+ flow_slug: string;
125
+ initial_tasks: number | null;
126
+ remaining_deps: number;
127
+ remaining_tasks: number | null;
128
+ run_id: string;
129
+ started_at: string | null;
130
+ status: string;
131
+ step_slug: string;
132
+ };
133
+ Insert: {
134
+ completed_at?: string | null;
135
+ created_at?: string;
136
+ error_message?: string | null;
137
+ failed_at?: string | null;
138
+ flow_slug: string;
139
+ initial_tasks?: number | null;
140
+ remaining_deps?: number;
141
+ remaining_tasks?: number | null;
142
+ run_id: string;
143
+ started_at?: string | null;
144
+ status?: string;
145
+ step_slug: string;
146
+ };
147
+ Update: {
148
+ completed_at?: string | null;
149
+ created_at?: string;
150
+ error_message?: string | null;
151
+ failed_at?: string | null;
152
+ flow_slug?: string;
153
+ initial_tasks?: number | null;
154
+ remaining_deps?: number;
155
+ remaining_tasks?: number | null;
156
+ run_id?: string;
157
+ started_at?: string | null;
158
+ status?: string;
159
+ step_slug?: string;
160
+ };
161
+ Relationships: [
162
+ {
163
+ foreignKeyName: "step_states_flow_slug_fkey";
164
+ columns: ["flow_slug"];
165
+ isOneToOne: false;
166
+ referencedRelation: "flows";
167
+ referencedColumns: ["flow_slug"];
168
+ },
169
+ {
170
+ foreignKeyName: "step_states_flow_slug_step_slug_fkey";
171
+ columns: ["flow_slug", "step_slug"];
172
+ isOneToOne: false;
173
+ referencedRelation: "steps";
174
+ referencedColumns: ["flow_slug", "step_slug"];
175
+ },
176
+ {
177
+ foreignKeyName: "step_states_run_id_fkey";
178
+ columns: ["run_id"];
179
+ isOneToOne: false;
180
+ referencedRelation: "runs";
181
+ referencedColumns: ["run_id"];
182
+ }
183
+ ];
184
+ };
185
+ step_tasks: {
186
+ Row: {
187
+ attempts_count: number;
188
+ completed_at: string | null;
189
+ error_message: string | null;
190
+ failed_at: string | null;
191
+ flow_slug: string;
192
+ last_worker_id: string | null;
193
+ message_id: number | null;
194
+ output: Json | null;
195
+ queued_at: string;
196
+ run_id: string;
197
+ started_at: string | null;
198
+ status: string;
199
+ step_slug: string;
200
+ task_index: number;
201
+ };
202
+ Insert: {
203
+ attempts_count?: number;
204
+ completed_at?: string | null;
205
+ error_message?: string | null;
206
+ failed_at?: string | null;
207
+ flow_slug: string;
208
+ last_worker_id?: string | null;
209
+ message_id?: number | null;
210
+ output?: Json | null;
211
+ queued_at?: string;
212
+ run_id: string;
213
+ started_at?: string | null;
214
+ status?: string;
215
+ step_slug: string;
216
+ task_index?: number;
217
+ };
218
+ Update: {
219
+ attempts_count?: number;
220
+ completed_at?: string | null;
221
+ error_message?: string | null;
222
+ failed_at?: string | null;
223
+ flow_slug?: string;
224
+ last_worker_id?: string | null;
225
+ message_id?: number | null;
226
+ output?: Json | null;
227
+ queued_at?: string;
228
+ run_id?: string;
229
+ started_at?: string | null;
230
+ status?: string;
231
+ step_slug?: string;
232
+ task_index?: number;
233
+ };
234
+ Relationships: [
235
+ {
236
+ foreignKeyName: "step_tasks_flow_slug_fkey";
237
+ columns: ["flow_slug"];
238
+ isOneToOne: false;
239
+ referencedRelation: "flows";
240
+ referencedColumns: ["flow_slug"];
241
+ },
242
+ {
243
+ foreignKeyName: "step_tasks_last_worker_id_fkey";
244
+ columns: ["last_worker_id"];
245
+ isOneToOne: false;
246
+ referencedRelation: "workers";
247
+ referencedColumns: ["worker_id"];
248
+ },
249
+ {
250
+ foreignKeyName: "step_tasks_run_id_fkey";
251
+ columns: ["run_id"];
252
+ isOneToOne: false;
253
+ referencedRelation: "runs";
254
+ referencedColumns: ["run_id"];
255
+ },
256
+ {
257
+ foreignKeyName: "step_tasks_run_id_step_slug_fkey";
258
+ columns: ["run_id", "step_slug"];
259
+ isOneToOne: false;
260
+ referencedRelation: "step_states";
261
+ referencedColumns: ["run_id", "step_slug"];
262
+ }
263
+ ];
264
+ };
265
+ steps: {
266
+ Row: {
267
+ created_at: string;
268
+ deps_count: number;
269
+ flow_slug: string;
270
+ opt_base_delay: number | null;
271
+ opt_max_attempts: number | null;
272
+ opt_start_delay: number | null;
273
+ opt_timeout: number | null;
274
+ step_index: number;
275
+ step_slug: string;
276
+ step_type: string;
277
+ };
278
+ Insert: {
279
+ created_at?: string;
280
+ deps_count?: number;
281
+ flow_slug: string;
282
+ opt_base_delay?: number | null;
283
+ opt_max_attempts?: number | null;
284
+ opt_start_delay?: number | null;
285
+ opt_timeout?: number | null;
286
+ step_index?: number;
287
+ step_slug: string;
288
+ step_type?: string;
289
+ };
290
+ Update: {
291
+ created_at?: string;
292
+ deps_count?: number;
293
+ flow_slug?: string;
294
+ opt_base_delay?: number | null;
295
+ opt_max_attempts?: number | null;
296
+ opt_start_delay?: number | null;
297
+ opt_timeout?: number | null;
298
+ step_index?: number;
299
+ step_slug?: string;
300
+ step_type?: string;
301
+ };
302
+ Relationships: [
303
+ {
304
+ foreignKeyName: "steps_flow_slug_fkey";
305
+ columns: ["flow_slug"];
306
+ isOneToOne: false;
307
+ referencedRelation: "flows";
308
+ referencedColumns: ["flow_slug"];
309
+ }
310
+ ];
311
+ };
312
+ workers: {
313
+ Row: {
314
+ deprecated_at: string | null;
315
+ function_name: string;
316
+ last_heartbeat_at: string;
317
+ queue_name: string;
318
+ started_at: string;
319
+ worker_id: string;
320
+ };
321
+ Insert: {
322
+ deprecated_at?: string | null;
323
+ function_name: string;
324
+ last_heartbeat_at?: string;
325
+ queue_name: string;
326
+ started_at?: string;
327
+ worker_id: string;
328
+ };
329
+ Update: {
330
+ deprecated_at?: string | null;
331
+ function_name?: string;
332
+ last_heartbeat_at?: string;
333
+ queue_name?: string;
334
+ started_at?: string;
335
+ worker_id?: string;
336
+ };
337
+ Relationships: [];
338
+ };
339
+ };
340
+ Views: {
341
+ [_ in never]: never;
342
+ };
343
+ Functions: {
344
+ _compare_flow_shapes: {
345
+ Args: {
346
+ p_db: Json;
347
+ p_local: Json;
348
+ };
349
+ Returns: string[];
350
+ };
351
+ _create_flow_from_shape: {
352
+ Args: {
353
+ p_flow_slug: string;
354
+ p_shape: Json;
355
+ };
356
+ Returns: undefined;
357
+ };
358
+ _get_flow_shape: {
359
+ Args: {
360
+ p_flow_slug: string;
361
+ };
362
+ Returns: Json;
363
+ };
364
+ add_step: {
365
+ Args: {
366
+ base_delay?: number;
367
+ deps_slugs?: string[];
368
+ flow_slug: string;
369
+ max_attempts?: number;
370
+ start_delay?: number;
371
+ step_slug: string;
372
+ step_type?: string;
373
+ timeout?: number;
374
+ };
375
+ Returns: {
376
+ created_at: string;
377
+ deps_count: number;
378
+ flow_slug: string;
379
+ opt_base_delay: number | null;
380
+ opt_max_attempts: number | null;
381
+ opt_start_delay: number | null;
382
+ opt_timeout: number | null;
383
+ step_index: number;
384
+ step_slug: string;
385
+ step_type: string;
386
+ };
387
+ SetofOptions: {
388
+ from: "*";
389
+ to: "steps";
390
+ isOneToOne: true;
391
+ isSetofReturn: false;
392
+ };
393
+ };
394
+ calculate_retry_delay: {
395
+ Args: {
396
+ attempts_count: number;
397
+ base_delay: number;
398
+ };
399
+ Returns: number;
400
+ };
401
+ cascade_complete_taskless_steps: {
402
+ Args: {
403
+ run_id: string;
404
+ };
405
+ Returns: number;
406
+ };
407
+ complete_task: {
408
+ Args: {
409
+ output: Json;
410
+ run_id: string;
411
+ step_slug: string;
412
+ task_index: number;
413
+ };
414
+ Returns: {
415
+ attempts_count: number;
416
+ completed_at: string | null;
417
+ error_message: string | null;
418
+ failed_at: string | null;
419
+ flow_slug: string;
420
+ last_worker_id: string | null;
421
+ message_id: number | null;
422
+ output: Json | null;
423
+ queued_at: string;
424
+ run_id: string;
425
+ started_at: string | null;
426
+ status: string;
427
+ step_slug: string;
428
+ task_index: number;
429
+ }[];
430
+ SetofOptions: {
431
+ from: "*";
432
+ to: "step_tasks";
433
+ isOneToOne: false;
434
+ isSetofReturn: true;
435
+ };
436
+ };
437
+ create_flow: {
438
+ Args: {
439
+ base_delay?: number;
440
+ flow_slug: string;
441
+ max_attempts?: number;
442
+ timeout?: number;
443
+ };
444
+ Returns: {
445
+ created_at: string;
446
+ flow_slug: string;
447
+ opt_base_delay: number;
448
+ opt_max_attempts: number;
449
+ opt_timeout: number;
450
+ };
451
+ SetofOptions: {
452
+ from: "*";
453
+ to: "flows";
454
+ isOneToOne: true;
455
+ isSetofReturn: false;
456
+ };
457
+ };
458
+ delete_flow_and_data: {
459
+ Args: {
460
+ p_flow_slug: string;
461
+ };
462
+ Returns: undefined;
463
+ };
464
+ ensure_flow_compiled: {
465
+ Args: {
466
+ p_flow_slug: string;
467
+ p_mode?: string;
468
+ p_shape: Json;
469
+ };
470
+ Returns: Json;
471
+ };
472
+ fail_task: {
473
+ Args: {
474
+ error_message: string;
475
+ run_id: string;
476
+ step_slug: string;
477
+ task_index: number;
478
+ };
479
+ Returns: {
480
+ attempts_count: number;
481
+ completed_at: string | null;
482
+ error_message: string | null;
483
+ failed_at: string | null;
484
+ flow_slug: string;
485
+ last_worker_id: string | null;
486
+ message_id: number | null;
487
+ output: Json | null;
488
+ queued_at: string;
489
+ run_id: string;
490
+ started_at: string | null;
491
+ status: string;
492
+ step_slug: string;
493
+ task_index: number;
494
+ }[];
495
+ SetofOptions: {
496
+ from: "*";
497
+ to: "step_tasks";
498
+ isOneToOne: false;
499
+ isSetofReturn: true;
500
+ };
501
+ };
502
+ get_run_with_states: {
503
+ Args: {
504
+ run_id: string;
505
+ };
506
+ Returns: Json;
507
+ };
508
+ is_valid_slug: {
509
+ Args: {
510
+ slug: string;
511
+ };
512
+ Returns: boolean;
513
+ };
514
+ maybe_complete_run: {
515
+ Args: {
516
+ run_id: string;
517
+ };
518
+ Returns: undefined;
519
+ };
520
+ poll_for_tasks: {
521
+ Args: {
522
+ max_poll_seconds?: number;
523
+ poll_interval_ms?: number;
524
+ qty: number;
525
+ queue_name: string;
526
+ vt: number;
527
+ };
528
+ Returns: Database["pgflow"]["CompositeTypes"]["step_task_record"][];
529
+ SetofOptions: {
530
+ from: "*";
531
+ to: "step_task_record";
532
+ isOneToOne: false;
533
+ isSetofReturn: true;
534
+ };
535
+ };
536
+ set_vt_batch: {
537
+ Args: {
538
+ msg_ids: number[];
539
+ queue_name: string;
540
+ vt_offsets: number[];
541
+ };
542
+ Returns: {
543
+ enqueued_at: string;
544
+ headers: Json;
545
+ message: Json;
546
+ msg_id: number;
547
+ read_ct: number;
548
+ vt: string;
549
+ }[];
550
+ };
551
+ start_flow: {
552
+ Args: {
553
+ flow_slug: string;
554
+ input: Json;
555
+ run_id?: string;
556
+ };
557
+ Returns: {
558
+ completed_at: string | null;
559
+ failed_at: string | null;
560
+ flow_slug: string;
561
+ input: Json;
562
+ output: Json | null;
563
+ remaining_steps: number;
564
+ run_id: string;
565
+ started_at: string;
566
+ status: string;
567
+ }[];
568
+ SetofOptions: {
569
+ from: "*";
570
+ to: "runs";
571
+ isOneToOne: false;
572
+ isSetofReturn: true;
573
+ };
574
+ };
575
+ start_flow_with_states: {
576
+ Args: {
577
+ flow_slug: string;
578
+ input: Json;
579
+ run_id?: string;
580
+ };
581
+ Returns: Json;
582
+ };
583
+ start_ready_steps: {
584
+ Args: {
585
+ run_id: string;
586
+ };
587
+ Returns: undefined;
588
+ };
589
+ start_tasks: {
590
+ Args: {
591
+ flow_slug: string;
592
+ msg_ids: number[];
593
+ worker_id: string;
594
+ };
595
+ Returns: Database["pgflow"]["CompositeTypes"]["step_task_record"][];
596
+ SetofOptions: {
597
+ from: "*";
598
+ to: "step_task_record";
599
+ isOneToOne: false;
600
+ isSetofReturn: true;
601
+ };
602
+ };
603
+ };
604
+ Enums: {
605
+ [_ in never]: never;
606
+ };
607
+ CompositeTypes: {
608
+ step_task_record: {
609
+ flow_slug: string | null;
610
+ run_id: string | null;
611
+ step_slug: string | null;
612
+ input: Json | null;
613
+ msg_id: number | null;
614
+ task_index: number | null;
615
+ };
616
+ };
617
+ };
618
+ pgmq: {
619
+ Tables: {
620
+ meta: {
621
+ Row: {
622
+ created_at: string;
623
+ is_partitioned: boolean;
624
+ is_unlogged: boolean;
625
+ queue_name: string;
626
+ };
627
+ Insert: {
628
+ created_at?: string;
629
+ is_partitioned: boolean;
630
+ is_unlogged: boolean;
631
+ queue_name: string;
632
+ };
633
+ Update: {
634
+ created_at?: string;
635
+ is_partitioned?: boolean;
636
+ is_unlogged?: boolean;
637
+ queue_name?: string;
638
+ };
639
+ Relationships: [];
640
+ };
641
+ };
642
+ Views: {
643
+ [_ in never]: never;
644
+ };
645
+ Functions: {
646
+ _belongs_to_pgmq: {
647
+ Args: {
648
+ table_name: string;
649
+ };
650
+ Returns: boolean;
651
+ };
652
+ _ensure_pg_partman_installed: {
653
+ Args: never;
654
+ Returns: undefined;
655
+ };
656
+ _extension_exists: {
657
+ Args: {
658
+ extension_name: string;
659
+ };
660
+ Returns: boolean;
661
+ };
662
+ _get_partition_col: {
663
+ Args: {
664
+ partition_interval: string;
665
+ };
666
+ Returns: string;
667
+ };
668
+ _get_pg_partman_major_version: {
669
+ Args: never;
670
+ Returns: number;
671
+ };
672
+ _get_pg_partman_schema: {
673
+ Args: never;
674
+ Returns: string;
675
+ };
676
+ archive: {
677
+ Args: {
678
+ msg_id: number;
679
+ queue_name: string;
680
+ };
681
+ Returns: boolean;
682
+ } | {
683
+ Args: {
684
+ msg_ids: number[];
685
+ queue_name: string;
686
+ };
687
+ Returns: number[];
688
+ };
689
+ convert_archive_partitioned: {
690
+ Args: {
691
+ leading_partition?: number;
692
+ partition_interval?: string;
693
+ retention_interval?: string;
694
+ table_name: string;
695
+ };
696
+ Returns: undefined;
697
+ };
698
+ create: {
699
+ Args: {
700
+ queue_name: string;
701
+ };
702
+ Returns: undefined;
703
+ };
704
+ create_non_partitioned: {
705
+ Args: {
706
+ queue_name: string;
707
+ };
708
+ Returns: undefined;
709
+ };
710
+ create_partitioned: {
711
+ Args: {
712
+ partition_interval?: string;
713
+ queue_name: string;
714
+ retention_interval?: string;
715
+ };
716
+ Returns: undefined;
717
+ };
718
+ create_unlogged: {
719
+ Args: {
720
+ queue_name: string;
721
+ };
722
+ Returns: undefined;
723
+ };
724
+ delete: {
725
+ Args: {
726
+ msg_id: number;
727
+ queue_name: string;
728
+ };
729
+ Returns: boolean;
730
+ } | {
731
+ Args: {
732
+ msg_ids: number[];
733
+ queue_name: string;
734
+ };
735
+ Returns: number[];
736
+ };
737
+ detach_archive: {
738
+ Args: {
739
+ queue_name: string;
740
+ };
741
+ Returns: undefined;
742
+ };
743
+ drop_queue: {
744
+ Args: {
745
+ queue_name: string;
746
+ };
747
+ Returns: boolean;
748
+ } | {
749
+ Args: {
750
+ partitioned: boolean;
751
+ queue_name: string;
752
+ };
753
+ Returns: boolean;
754
+ };
755
+ format_table_name: {
756
+ Args: {
757
+ prefix: string;
758
+ queue_name: string;
759
+ };
760
+ Returns: string;
761
+ };
762
+ list_queues: {
763
+ Args: never;
764
+ Returns: Database["pgmq"]["CompositeTypes"]["queue_record"][];
765
+ SetofOptions: {
766
+ from: "*";
767
+ to: "queue_record";
768
+ isOneToOne: false;
769
+ isSetofReturn: true;
770
+ };
771
+ };
772
+ metrics: {
773
+ Args: {
774
+ queue_name: string;
775
+ };
776
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"];
777
+ SetofOptions: {
778
+ from: "*";
779
+ to: "metrics_result";
780
+ isOneToOne: true;
781
+ isSetofReturn: false;
782
+ };
783
+ };
784
+ metrics_all: {
785
+ Args: never;
786
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"][];
787
+ SetofOptions: {
788
+ from: "*";
789
+ to: "metrics_result";
790
+ isOneToOne: false;
791
+ isSetofReturn: true;
792
+ };
793
+ };
794
+ pop: {
795
+ Args: {
796
+ queue_name: string;
797
+ };
798
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
799
+ SetofOptions: {
800
+ from: "*";
801
+ to: "message_record";
802
+ isOneToOne: false;
803
+ isSetofReturn: true;
804
+ };
805
+ };
806
+ purge_queue: {
807
+ Args: {
808
+ queue_name: string;
809
+ };
810
+ Returns: number;
811
+ };
812
+ read: {
813
+ Args: {
814
+ conditional?: Json;
815
+ qty: number;
816
+ queue_name: string;
817
+ vt: number;
818
+ };
819
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
820
+ SetofOptions: {
821
+ from: "*";
822
+ to: "message_record";
823
+ isOneToOne: false;
824
+ isSetofReturn: true;
825
+ };
826
+ };
827
+ read_with_poll: {
828
+ Args: {
829
+ conditional?: Json;
830
+ max_poll_seconds?: number;
831
+ poll_interval_ms?: number;
832
+ qty: number;
833
+ queue_name: string;
834
+ vt: number;
835
+ };
836
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
837
+ SetofOptions: {
838
+ from: "*";
839
+ to: "message_record";
840
+ isOneToOne: false;
841
+ isSetofReturn: true;
842
+ };
843
+ };
844
+ send: {
845
+ Args: {
846
+ delay: string;
847
+ headers: Json;
848
+ msg: Json;
849
+ queue_name: string;
850
+ };
851
+ Returns: number[];
852
+ } | {
853
+ Args: {
854
+ delay: string;
855
+ msg: Json;
856
+ queue_name: string;
857
+ };
858
+ Returns: number[];
859
+ } | {
860
+ Args: {
861
+ msg: Json;
862
+ queue_name: string;
863
+ };
864
+ Returns: number[];
865
+ } | {
866
+ Args: {
867
+ delay: number;
868
+ msg: Json;
869
+ queue_name: string;
870
+ };
871
+ Returns: number[];
872
+ } | {
873
+ Args: {
874
+ headers: Json;
875
+ msg: Json;
876
+ queue_name: string;
877
+ };
878
+ Returns: number[];
879
+ } | {
880
+ Args: {
881
+ delay: number;
882
+ headers: Json;
883
+ msg: Json;
884
+ queue_name: string;
885
+ };
886
+ Returns: number[];
887
+ };
888
+ send_batch: {
889
+ Args: {
890
+ delay: string;
891
+ headers: Json[];
892
+ msgs: Json[];
893
+ queue_name: string;
894
+ };
895
+ Returns: number[];
896
+ } | {
897
+ Args: {
898
+ delay: string;
899
+ msgs: Json[];
900
+ queue_name: string;
901
+ };
902
+ Returns: number[];
903
+ } | {
904
+ Args: {
905
+ msgs: Json[];
906
+ queue_name: string;
907
+ };
908
+ Returns: number[];
909
+ } | {
910
+ Args: {
911
+ delay: number;
912
+ msgs: Json[];
913
+ queue_name: string;
914
+ };
915
+ Returns: number[];
916
+ } | {
917
+ Args: {
918
+ headers: Json[];
919
+ msgs: Json[];
920
+ queue_name: string;
921
+ };
922
+ Returns: number[];
923
+ } | {
924
+ Args: {
925
+ delay: number;
926
+ headers: Json[];
927
+ msgs: Json[];
928
+ queue_name: string;
929
+ };
930
+ Returns: number[];
931
+ };
932
+ set_vt: {
933
+ Args: {
934
+ msg_id: number;
935
+ queue_name: string;
936
+ vt: number;
937
+ };
938
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
939
+ SetofOptions: {
940
+ from: "*";
941
+ to: "message_record";
942
+ isOneToOne: false;
943
+ isSetofReturn: true;
944
+ };
945
+ };
946
+ validate_queue_name: {
947
+ Args: {
948
+ queue_name: string;
949
+ };
950
+ Returns: undefined;
951
+ };
952
+ };
953
+ Enums: {
954
+ [_ in never]: never;
955
+ };
956
+ CompositeTypes: {
957
+ message_record: {
958
+ msg_id: number | null;
959
+ read_ct: number | null;
960
+ enqueued_at: string | null;
961
+ vt: string | null;
962
+ message: Json | null;
963
+ headers: Json | null;
964
+ };
965
+ metrics_result: {
966
+ queue_name: string | null;
967
+ queue_length: number | null;
968
+ newest_msg_age_sec: number | null;
969
+ oldest_msg_age_sec: number | null;
970
+ total_messages: number | null;
971
+ scrape_time: string | null;
972
+ queue_visible_length: number | null;
973
+ };
974
+ queue_record: {
975
+ queue_name: string | null;
976
+ is_partitioned: boolean | null;
977
+ is_unlogged: boolean | null;
978
+ created_at: string | null;
979
+ };
980
+ };
981
+ };
982
+ };
983
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
984
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
985
+ export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
986
+ schema: keyof DatabaseWithoutInternals;
987
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
988
+ schema: keyof DatabaseWithoutInternals;
989
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
990
+ schema: keyof DatabaseWithoutInternals;
991
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
992
+ Row: infer R;
993
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
994
+ Row: infer R;
995
+ } ? R : never : never;
996
+ export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
997
+ schema: keyof DatabaseWithoutInternals;
998
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
999
+ schema: keyof DatabaseWithoutInternals;
1000
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
1001
+ schema: keyof DatabaseWithoutInternals;
1002
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1003
+ Insert: infer I;
1004
+ } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
1005
+ Insert: infer I;
1006
+ } ? I : never : never;
1007
+ export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
1008
+ schema: keyof DatabaseWithoutInternals;
1009
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
1010
+ schema: keyof DatabaseWithoutInternals;
1011
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
1012
+ schema: keyof DatabaseWithoutInternals;
1013
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1014
+ Update: infer U;
1015
+ } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
1016
+ Update: infer U;
1017
+ } ? U : never : never;
1018
+ export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
1019
+ schema: keyof DatabaseWithoutInternals;
1020
+ }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
1021
+ schema: keyof DatabaseWithoutInternals;
1022
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
1023
+ schema: keyof DatabaseWithoutInternals;
1024
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
1025
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
1026
+ schema: keyof DatabaseWithoutInternals;
1027
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
1028
+ schema: keyof DatabaseWithoutInternals;
1029
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
1030
+ schema: keyof DatabaseWithoutInternals;
1031
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
1032
+ export declare const Constants: {
1033
+ readonly pgflow: {
1034
+ readonly Enums: {};
1035
+ };
1036
+ readonly pgmq: {
1037
+ readonly Enums: {};
1038
+ };
1039
+ };
1040
+ export {};
1041
+ //# sourceMappingURL=database-types.d.ts.map