@pgflow/core 0.0.0-test-snapshot-releases2-8d5d9bc1-20250922101158 → 0.0.0-update-supabase-868977e5-20251119071204

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 (31) hide show
  1. package/README.md +177 -73
  2. package/dist/ATLAS.md +32 -0
  3. package/dist/CHANGELOG.md +796 -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 +1007 -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 +32 -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/tsconfig.lib.tsbuildinfo +1 -0
  28. package/dist/types.d.ts +93 -0
  29. package/dist/types.d.ts.map +1 -0
  30. package/dist/types.js +1 -0
  31. package/package.json +4 -4
@@ -0,0 +1,1007 @@
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
+ add_step: {
345
+ Args: {
346
+ base_delay?: number;
347
+ deps_slugs?: string[];
348
+ flow_slug: string;
349
+ max_attempts?: number;
350
+ start_delay?: number;
351
+ step_slug: string;
352
+ step_type?: string;
353
+ timeout?: number;
354
+ };
355
+ Returns: {
356
+ created_at: string;
357
+ deps_count: number;
358
+ flow_slug: string;
359
+ opt_base_delay: number | null;
360
+ opt_max_attempts: number | null;
361
+ opt_start_delay: number | null;
362
+ opt_timeout: number | null;
363
+ step_index: number;
364
+ step_slug: string;
365
+ step_type: string;
366
+ };
367
+ SetofOptions: {
368
+ from: "*";
369
+ to: "steps";
370
+ isOneToOne: true;
371
+ isSetofReturn: false;
372
+ };
373
+ };
374
+ calculate_retry_delay: {
375
+ Args: {
376
+ attempts_count: number;
377
+ base_delay: number;
378
+ };
379
+ Returns: number;
380
+ };
381
+ cascade_complete_taskless_steps: {
382
+ Args: {
383
+ run_id: string;
384
+ };
385
+ Returns: number;
386
+ };
387
+ complete_task: {
388
+ Args: {
389
+ output: Json;
390
+ run_id: string;
391
+ step_slug: string;
392
+ task_index: number;
393
+ };
394
+ Returns: {
395
+ attempts_count: number;
396
+ completed_at: string | null;
397
+ error_message: string | null;
398
+ failed_at: string | null;
399
+ flow_slug: string;
400
+ last_worker_id: string | null;
401
+ message_id: number | null;
402
+ output: Json | null;
403
+ queued_at: string;
404
+ run_id: string;
405
+ started_at: string | null;
406
+ status: string;
407
+ step_slug: string;
408
+ task_index: number;
409
+ }[];
410
+ SetofOptions: {
411
+ from: "*";
412
+ to: "step_tasks";
413
+ isOneToOne: false;
414
+ isSetofReturn: true;
415
+ };
416
+ };
417
+ create_flow: {
418
+ Args: {
419
+ base_delay?: number;
420
+ flow_slug: string;
421
+ max_attempts?: number;
422
+ timeout?: number;
423
+ };
424
+ Returns: {
425
+ created_at: string;
426
+ flow_slug: string;
427
+ opt_base_delay: number;
428
+ opt_max_attempts: number;
429
+ opt_timeout: number;
430
+ };
431
+ SetofOptions: {
432
+ from: "*";
433
+ to: "flows";
434
+ isOneToOne: true;
435
+ isSetofReturn: false;
436
+ };
437
+ };
438
+ fail_task: {
439
+ Args: {
440
+ error_message: string;
441
+ run_id: string;
442
+ step_slug: string;
443
+ task_index: number;
444
+ };
445
+ Returns: {
446
+ attempts_count: number;
447
+ completed_at: string | null;
448
+ error_message: string | null;
449
+ failed_at: string | null;
450
+ flow_slug: string;
451
+ last_worker_id: string | null;
452
+ message_id: number | null;
453
+ output: Json | null;
454
+ queued_at: string;
455
+ run_id: string;
456
+ started_at: string | null;
457
+ status: string;
458
+ step_slug: string;
459
+ task_index: number;
460
+ }[];
461
+ SetofOptions: {
462
+ from: "*";
463
+ to: "step_tasks";
464
+ isOneToOne: false;
465
+ isSetofReturn: true;
466
+ };
467
+ };
468
+ get_run_with_states: {
469
+ Args: {
470
+ run_id: string;
471
+ };
472
+ Returns: Json;
473
+ };
474
+ is_valid_slug: {
475
+ Args: {
476
+ slug: string;
477
+ };
478
+ Returns: boolean;
479
+ };
480
+ maybe_complete_run: {
481
+ Args: {
482
+ run_id: string;
483
+ };
484
+ Returns: undefined;
485
+ };
486
+ poll_for_tasks: {
487
+ Args: {
488
+ max_poll_seconds?: number;
489
+ poll_interval_ms?: number;
490
+ qty: number;
491
+ queue_name: string;
492
+ vt: number;
493
+ };
494
+ Returns: Database["pgflow"]["CompositeTypes"]["step_task_record"][];
495
+ SetofOptions: {
496
+ from: "*";
497
+ to: "step_task_record";
498
+ isOneToOne: false;
499
+ isSetofReturn: true;
500
+ };
501
+ };
502
+ set_vt_batch: {
503
+ Args: {
504
+ msg_ids: number[];
505
+ queue_name: string;
506
+ vt_offsets: number[];
507
+ };
508
+ Returns: {
509
+ enqueued_at: string;
510
+ headers: Json;
511
+ message: Json;
512
+ msg_id: number;
513
+ read_ct: number;
514
+ vt: string;
515
+ }[];
516
+ };
517
+ start_flow: {
518
+ Args: {
519
+ flow_slug: string;
520
+ input: Json;
521
+ run_id?: string;
522
+ };
523
+ Returns: {
524
+ completed_at: string | null;
525
+ failed_at: string | null;
526
+ flow_slug: string;
527
+ input: Json;
528
+ output: Json | null;
529
+ remaining_steps: number;
530
+ run_id: string;
531
+ started_at: string;
532
+ status: string;
533
+ }[];
534
+ SetofOptions: {
535
+ from: "*";
536
+ to: "runs";
537
+ isOneToOne: false;
538
+ isSetofReturn: true;
539
+ };
540
+ };
541
+ start_flow_with_states: {
542
+ Args: {
543
+ flow_slug: string;
544
+ input: Json;
545
+ run_id?: string;
546
+ };
547
+ Returns: Json;
548
+ };
549
+ start_ready_steps: {
550
+ Args: {
551
+ run_id: string;
552
+ };
553
+ Returns: undefined;
554
+ };
555
+ start_tasks: {
556
+ Args: {
557
+ flow_slug: string;
558
+ msg_ids: number[];
559
+ worker_id: string;
560
+ };
561
+ Returns: Database["pgflow"]["CompositeTypes"]["step_task_record"][];
562
+ SetofOptions: {
563
+ from: "*";
564
+ to: "step_task_record";
565
+ isOneToOne: false;
566
+ isSetofReturn: true;
567
+ };
568
+ };
569
+ };
570
+ Enums: {
571
+ [_ in never]: never;
572
+ };
573
+ CompositeTypes: {
574
+ step_task_record: {
575
+ flow_slug: string | null;
576
+ run_id: string | null;
577
+ step_slug: string | null;
578
+ input: Json | null;
579
+ msg_id: number | null;
580
+ task_index: number | null;
581
+ };
582
+ };
583
+ };
584
+ pgmq: {
585
+ Tables: {
586
+ meta: {
587
+ Row: {
588
+ created_at: string;
589
+ is_partitioned: boolean;
590
+ is_unlogged: boolean;
591
+ queue_name: string;
592
+ };
593
+ Insert: {
594
+ created_at?: string;
595
+ is_partitioned: boolean;
596
+ is_unlogged: boolean;
597
+ queue_name: string;
598
+ };
599
+ Update: {
600
+ created_at?: string;
601
+ is_partitioned?: boolean;
602
+ is_unlogged?: boolean;
603
+ queue_name?: string;
604
+ };
605
+ Relationships: [];
606
+ };
607
+ };
608
+ Views: {
609
+ [_ in never]: never;
610
+ };
611
+ Functions: {
612
+ _belongs_to_pgmq: {
613
+ Args: {
614
+ table_name: string;
615
+ };
616
+ Returns: boolean;
617
+ };
618
+ _ensure_pg_partman_installed: {
619
+ Args: never;
620
+ Returns: undefined;
621
+ };
622
+ _extension_exists: {
623
+ Args: {
624
+ extension_name: string;
625
+ };
626
+ Returns: boolean;
627
+ };
628
+ _get_partition_col: {
629
+ Args: {
630
+ partition_interval: string;
631
+ };
632
+ Returns: string;
633
+ };
634
+ _get_pg_partman_major_version: {
635
+ Args: never;
636
+ Returns: number;
637
+ };
638
+ _get_pg_partman_schema: {
639
+ Args: never;
640
+ Returns: string;
641
+ };
642
+ archive: {
643
+ Args: {
644
+ msg_id: number;
645
+ queue_name: string;
646
+ };
647
+ Returns: boolean;
648
+ } | {
649
+ Args: {
650
+ msg_ids: number[];
651
+ queue_name: string;
652
+ };
653
+ Returns: number[];
654
+ };
655
+ convert_archive_partitioned: {
656
+ Args: {
657
+ leading_partition?: number;
658
+ partition_interval?: string;
659
+ retention_interval?: string;
660
+ table_name: string;
661
+ };
662
+ Returns: undefined;
663
+ };
664
+ create: {
665
+ Args: {
666
+ queue_name: string;
667
+ };
668
+ Returns: undefined;
669
+ };
670
+ create_non_partitioned: {
671
+ Args: {
672
+ queue_name: string;
673
+ };
674
+ Returns: undefined;
675
+ };
676
+ create_partitioned: {
677
+ Args: {
678
+ partition_interval?: string;
679
+ queue_name: string;
680
+ retention_interval?: string;
681
+ };
682
+ Returns: undefined;
683
+ };
684
+ create_unlogged: {
685
+ Args: {
686
+ queue_name: string;
687
+ };
688
+ Returns: undefined;
689
+ };
690
+ delete: {
691
+ Args: {
692
+ msg_id: number;
693
+ queue_name: string;
694
+ };
695
+ Returns: boolean;
696
+ } | {
697
+ Args: {
698
+ msg_ids: number[];
699
+ queue_name: string;
700
+ };
701
+ Returns: number[];
702
+ };
703
+ detach_archive: {
704
+ Args: {
705
+ queue_name: string;
706
+ };
707
+ Returns: undefined;
708
+ };
709
+ drop_queue: {
710
+ Args: {
711
+ queue_name: string;
712
+ };
713
+ Returns: boolean;
714
+ } | {
715
+ Args: {
716
+ partitioned: boolean;
717
+ queue_name: string;
718
+ };
719
+ Returns: boolean;
720
+ };
721
+ format_table_name: {
722
+ Args: {
723
+ prefix: string;
724
+ queue_name: string;
725
+ };
726
+ Returns: string;
727
+ };
728
+ list_queues: {
729
+ Args: never;
730
+ Returns: Database["pgmq"]["CompositeTypes"]["queue_record"][];
731
+ SetofOptions: {
732
+ from: "*";
733
+ to: "queue_record";
734
+ isOneToOne: false;
735
+ isSetofReturn: true;
736
+ };
737
+ };
738
+ metrics: {
739
+ Args: {
740
+ queue_name: string;
741
+ };
742
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"];
743
+ SetofOptions: {
744
+ from: "*";
745
+ to: "metrics_result";
746
+ isOneToOne: true;
747
+ isSetofReturn: false;
748
+ };
749
+ };
750
+ metrics_all: {
751
+ Args: never;
752
+ Returns: Database["pgmq"]["CompositeTypes"]["metrics_result"][];
753
+ SetofOptions: {
754
+ from: "*";
755
+ to: "metrics_result";
756
+ isOneToOne: false;
757
+ isSetofReturn: true;
758
+ };
759
+ };
760
+ pop: {
761
+ Args: {
762
+ queue_name: string;
763
+ };
764
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
765
+ SetofOptions: {
766
+ from: "*";
767
+ to: "message_record";
768
+ isOneToOne: false;
769
+ isSetofReturn: true;
770
+ };
771
+ };
772
+ purge_queue: {
773
+ Args: {
774
+ queue_name: string;
775
+ };
776
+ Returns: number;
777
+ };
778
+ read: {
779
+ Args: {
780
+ conditional?: Json;
781
+ qty: number;
782
+ queue_name: string;
783
+ vt: number;
784
+ };
785
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
786
+ SetofOptions: {
787
+ from: "*";
788
+ to: "message_record";
789
+ isOneToOne: false;
790
+ isSetofReturn: true;
791
+ };
792
+ };
793
+ read_with_poll: {
794
+ Args: {
795
+ conditional?: Json;
796
+ max_poll_seconds?: number;
797
+ poll_interval_ms?: number;
798
+ qty: number;
799
+ queue_name: string;
800
+ vt: number;
801
+ };
802
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
803
+ SetofOptions: {
804
+ from: "*";
805
+ to: "message_record";
806
+ isOneToOne: false;
807
+ isSetofReturn: true;
808
+ };
809
+ };
810
+ send: {
811
+ Args: {
812
+ delay: string;
813
+ headers: Json;
814
+ msg: Json;
815
+ queue_name: string;
816
+ };
817
+ Returns: number[];
818
+ } | {
819
+ Args: {
820
+ delay: string;
821
+ msg: Json;
822
+ queue_name: string;
823
+ };
824
+ Returns: number[];
825
+ } | {
826
+ Args: {
827
+ msg: Json;
828
+ queue_name: string;
829
+ };
830
+ Returns: number[];
831
+ } | {
832
+ Args: {
833
+ delay: number;
834
+ msg: Json;
835
+ queue_name: string;
836
+ };
837
+ Returns: number[];
838
+ } | {
839
+ Args: {
840
+ headers: Json;
841
+ msg: Json;
842
+ queue_name: string;
843
+ };
844
+ Returns: number[];
845
+ } | {
846
+ Args: {
847
+ delay: number;
848
+ headers: Json;
849
+ msg: Json;
850
+ queue_name: string;
851
+ };
852
+ Returns: number[];
853
+ };
854
+ send_batch: {
855
+ Args: {
856
+ delay: string;
857
+ headers: Json[];
858
+ msgs: Json[];
859
+ queue_name: string;
860
+ };
861
+ Returns: number[];
862
+ } | {
863
+ Args: {
864
+ delay: string;
865
+ msgs: Json[];
866
+ queue_name: string;
867
+ };
868
+ Returns: number[];
869
+ } | {
870
+ Args: {
871
+ msgs: Json[];
872
+ queue_name: string;
873
+ };
874
+ Returns: number[];
875
+ } | {
876
+ Args: {
877
+ delay: number;
878
+ msgs: Json[];
879
+ queue_name: string;
880
+ };
881
+ Returns: number[];
882
+ } | {
883
+ Args: {
884
+ headers: Json[];
885
+ msgs: Json[];
886
+ queue_name: string;
887
+ };
888
+ Returns: number[];
889
+ } | {
890
+ Args: {
891
+ delay: number;
892
+ headers: Json[];
893
+ msgs: Json[];
894
+ queue_name: string;
895
+ };
896
+ Returns: number[];
897
+ };
898
+ set_vt: {
899
+ Args: {
900
+ msg_id: number;
901
+ queue_name: string;
902
+ vt: number;
903
+ };
904
+ Returns: Database["pgmq"]["CompositeTypes"]["message_record"][];
905
+ SetofOptions: {
906
+ from: "*";
907
+ to: "message_record";
908
+ isOneToOne: false;
909
+ isSetofReturn: true;
910
+ };
911
+ };
912
+ validate_queue_name: {
913
+ Args: {
914
+ queue_name: string;
915
+ };
916
+ Returns: undefined;
917
+ };
918
+ };
919
+ Enums: {
920
+ [_ in never]: never;
921
+ };
922
+ CompositeTypes: {
923
+ message_record: {
924
+ msg_id: number | null;
925
+ read_ct: number | null;
926
+ enqueued_at: string | null;
927
+ vt: string | null;
928
+ message: Json | null;
929
+ headers: Json | null;
930
+ };
931
+ metrics_result: {
932
+ queue_name: string | null;
933
+ queue_length: number | null;
934
+ newest_msg_age_sec: number | null;
935
+ oldest_msg_age_sec: number | null;
936
+ total_messages: number | null;
937
+ scrape_time: string | null;
938
+ queue_visible_length: number | null;
939
+ };
940
+ queue_record: {
941
+ queue_name: string | null;
942
+ is_partitioned: boolean | null;
943
+ is_unlogged: boolean | null;
944
+ created_at: string | null;
945
+ };
946
+ };
947
+ };
948
+ };
949
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
950
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
951
+ export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
952
+ schema: keyof DatabaseWithoutInternals;
953
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
954
+ schema: keyof DatabaseWithoutInternals;
955
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
956
+ schema: keyof DatabaseWithoutInternals;
957
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
958
+ Row: infer R;
959
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
960
+ Row: infer R;
961
+ } ? R : never : never;
962
+ export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
963
+ schema: keyof DatabaseWithoutInternals;
964
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
965
+ schema: keyof DatabaseWithoutInternals;
966
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
967
+ schema: keyof DatabaseWithoutInternals;
968
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
969
+ Insert: infer I;
970
+ } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
971
+ Insert: infer I;
972
+ } ? I : never : never;
973
+ export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
974
+ schema: keyof DatabaseWithoutInternals;
975
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
976
+ schema: keyof DatabaseWithoutInternals;
977
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
978
+ schema: keyof DatabaseWithoutInternals;
979
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
980
+ Update: infer U;
981
+ } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
982
+ Update: infer U;
983
+ } ? U : never : never;
984
+ export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
985
+ schema: keyof DatabaseWithoutInternals;
986
+ }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
987
+ schema: keyof DatabaseWithoutInternals;
988
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
989
+ schema: keyof DatabaseWithoutInternals;
990
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
991
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
992
+ schema: keyof DatabaseWithoutInternals;
993
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
994
+ schema: keyof DatabaseWithoutInternals;
995
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
996
+ schema: keyof DatabaseWithoutInternals;
997
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
998
+ export declare const Constants: {
999
+ readonly pgflow: {
1000
+ readonly Enums: {};
1001
+ };
1002
+ readonly pgmq: {
1003
+ readonly Enums: {};
1004
+ };
1005
+ };
1006
+ export {};
1007
+ //# sourceMappingURL=database-types.d.ts.map