@pgpmjs/core 4.10.0 → 4.11.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.
@@ -4,6 +4,9 @@ exports.exportMeta = void 0;
4
4
  const csv_to_pg_1 = require("csv-to-pg");
5
5
  const pg_cache_1 = require("pg-cache");
6
6
  const config = {
7
+ // =============================================================================
8
+ // metaschema_public tables
9
+ // =============================================================================
7
10
  database: {
8
11
  schema: 'metaschema_public',
9
12
  table: 'database',
@@ -56,6 +59,183 @@ const config = {
56
59
  description: 'text'
57
60
  }
58
61
  },
62
+ policy: {
63
+ schema: 'metaschema_public',
64
+ table: 'policy',
65
+ fields: {
66
+ id: 'uuid',
67
+ database_id: 'uuid',
68
+ table_id: 'uuid',
69
+ name: 'text',
70
+ role_name: 'text',
71
+ privilege: 'text',
72
+ permissive: 'boolean',
73
+ disabled: 'boolean',
74
+ template: 'text',
75
+ data: 'jsonb'
76
+ }
77
+ },
78
+ index: {
79
+ schema: 'metaschema_public',
80
+ table: 'index',
81
+ fields: {
82
+ id: 'uuid',
83
+ database_id: 'uuid',
84
+ table_id: 'uuid',
85
+ name: 'text',
86
+ field_ids: 'uuid[]',
87
+ include_field_ids: 'uuid[]',
88
+ access_method: 'text',
89
+ index_params: 'jsonb',
90
+ where_clause: 'jsonb',
91
+ is_unique: 'boolean'
92
+ }
93
+ },
94
+ trigger: {
95
+ schema: 'metaschema_public',
96
+ table: 'trigger',
97
+ fields: {
98
+ id: 'uuid',
99
+ database_id: 'uuid',
100
+ table_id: 'uuid',
101
+ name: 'text',
102
+ event: 'text',
103
+ function_name: 'text'
104
+ }
105
+ },
106
+ trigger_function: {
107
+ schema: 'metaschema_public',
108
+ table: 'trigger_function',
109
+ fields: {
110
+ id: 'uuid',
111
+ database_id: 'uuid',
112
+ schema_id: 'uuid',
113
+ name: 'text'
114
+ }
115
+ },
116
+ rls_function: {
117
+ schema: 'metaschema_public',
118
+ table: 'rls_function',
119
+ fields: {
120
+ id: 'uuid',
121
+ database_id: 'uuid',
122
+ schema_id: 'uuid',
123
+ name: 'text'
124
+ }
125
+ },
126
+ limit_function: {
127
+ schema: 'metaschema_public',
128
+ table: 'limit_function',
129
+ fields: {
130
+ id: 'uuid',
131
+ database_id: 'uuid',
132
+ schema_id: 'uuid',
133
+ name: 'text'
134
+ }
135
+ },
136
+ procedure: {
137
+ schema: 'metaschema_public',
138
+ table: 'procedure',
139
+ fields: {
140
+ id: 'uuid',
141
+ database_id: 'uuid',
142
+ schema_id: 'uuid',
143
+ name: 'text'
144
+ }
145
+ },
146
+ foreign_key_constraint: {
147
+ schema: 'metaschema_public',
148
+ table: 'foreign_key_constraint',
149
+ fields: {
150
+ id: 'uuid',
151
+ database_id: 'uuid',
152
+ table_id: 'uuid',
153
+ name: 'text',
154
+ field_ids: 'uuid[]',
155
+ ref_table_id: 'uuid',
156
+ ref_field_ids: 'uuid[]',
157
+ on_delete: 'text',
158
+ on_update: 'text'
159
+ }
160
+ },
161
+ primary_key_constraint: {
162
+ schema: 'metaschema_public',
163
+ table: 'primary_key_constraint',
164
+ fields: {
165
+ id: 'uuid',
166
+ database_id: 'uuid',
167
+ table_id: 'uuid',
168
+ name: 'text',
169
+ field_ids: 'uuid[]'
170
+ }
171
+ },
172
+ unique_constraint: {
173
+ schema: 'metaschema_public',
174
+ table: 'unique_constraint',
175
+ fields: {
176
+ id: 'uuid',
177
+ database_id: 'uuid',
178
+ table_id: 'uuid',
179
+ name: 'text',
180
+ field_ids: 'uuid[]'
181
+ }
182
+ },
183
+ check_constraint: {
184
+ schema: 'metaschema_public',
185
+ table: 'check_constraint',
186
+ fields: {
187
+ id: 'uuid',
188
+ database_id: 'uuid',
189
+ table_id: 'uuid',
190
+ name: 'text',
191
+ expression: 'text'
192
+ }
193
+ },
194
+ full_text_search: {
195
+ schema: 'metaschema_public',
196
+ table: 'full_text_search',
197
+ fields: {
198
+ id: 'uuid',
199
+ database_id: 'uuid',
200
+ table_id: 'uuid',
201
+ name: 'text',
202
+ field_ids: 'uuid[]',
203
+ weights: 'text[]'
204
+ }
205
+ },
206
+ schema_grant: {
207
+ schema: 'metaschema_public',
208
+ table: 'schema_grant',
209
+ fields: {
210
+ id: 'uuid',
211
+ database_id: 'uuid',
212
+ schema_id: 'uuid',
213
+ role_name: 'text',
214
+ privilege: 'text'
215
+ }
216
+ },
217
+ table_grant: {
218
+ schema: 'metaschema_public',
219
+ table: 'table_grant',
220
+ fields: {
221
+ id: 'uuid',
222
+ database_id: 'uuid',
223
+ table_id: 'uuid',
224
+ role_name: 'text',
225
+ privilege: 'text'
226
+ }
227
+ },
228
+ extension: {
229
+ schema: 'metaschema_public',
230
+ table: 'extension',
231
+ fields: {
232
+ id: 'uuid',
233
+ name: 'text'
234
+ }
235
+ },
236
+ // =============================================================================
237
+ // services_public tables
238
+ // =============================================================================
59
239
  domains: {
60
240
  schema: 'services_public',
61
241
  table: 'domains',
@@ -132,6 +312,18 @@ const config = {
132
312
  theme: 'jsonb'
133
313
  }
134
314
  },
315
+ site_metadata: {
316
+ schema: 'services_public',
317
+ table: 'site_metadata',
318
+ fields: {
319
+ id: 'uuid',
320
+ database_id: 'uuid',
321
+ site_id: 'uuid',
322
+ title: 'text',
323
+ description: 'text',
324
+ og_image: 'image'
325
+ }
326
+ },
135
327
  api_modules: {
136
328
  schema: 'services_public',
137
329
  table: 'api_modules',
@@ -163,6 +355,9 @@ const config = {
163
355
  api_id: 'uuid'
164
356
  }
165
357
  },
358
+ // =============================================================================
359
+ // metaschema_modules_public tables
360
+ // =============================================================================
166
361
  rls_module: {
167
362
  schema: 'metaschema_modules_public',
168
363
  table: 'rls_module',
@@ -206,6 +401,375 @@ const config = {
206
401
  send_verification_email_function: 'text',
207
402
  verify_email_function: 'text'
208
403
  }
404
+ },
405
+ memberships_module: {
406
+ schema: 'metaschema_modules_public',
407
+ table: 'memberships_module',
408
+ fields: {
409
+ id: 'uuid',
410
+ database_id: 'uuid',
411
+ schema_id: 'uuid',
412
+ private_schema_id: 'uuid',
413
+ memberships_table_id: 'uuid',
414
+ memberships_table_name: 'text',
415
+ members_table_id: 'uuid',
416
+ members_table_name: 'text',
417
+ membership_defaults_table_id: 'uuid',
418
+ membership_defaults_table_name: 'text',
419
+ grants_table_id: 'uuid',
420
+ grants_table_name: 'text',
421
+ actor_table_id: 'uuid',
422
+ limits_table_id: 'uuid',
423
+ default_limits_table_id: 'uuid',
424
+ permissions_table_id: 'uuid',
425
+ default_permissions_table_id: 'uuid',
426
+ sprt_table_id: 'uuid',
427
+ admin_grants_table_id: 'uuid',
428
+ admin_grants_table_name: 'text',
429
+ owner_grants_table_id: 'uuid',
430
+ owner_grants_table_name: 'text',
431
+ membership_type: 'int',
432
+ entity_table_id: 'uuid',
433
+ entity_table_owner_id: 'uuid',
434
+ prefix: 'text',
435
+ actor_mask_check: 'text',
436
+ actor_perm_check: 'text',
437
+ entity_ids_by_mask: 'text',
438
+ entity_ids_by_perm: 'text',
439
+ entity_ids_function: 'text'
440
+ }
441
+ },
442
+ permissions_module: {
443
+ schema: 'metaschema_modules_public',
444
+ table: 'permissions_module',
445
+ fields: {
446
+ id: 'uuid',
447
+ database_id: 'uuid',
448
+ schema_id: 'uuid',
449
+ private_schema_id: 'uuid',
450
+ table_id: 'uuid',
451
+ table_name: 'text',
452
+ default_table_id: 'uuid',
453
+ default_table_name: 'text',
454
+ bitlen: 'int',
455
+ membership_type: 'int',
456
+ entity_table_id: 'uuid',
457
+ actor_table_id: 'uuid',
458
+ prefix: 'text',
459
+ get_padded_mask: 'text',
460
+ get_mask: 'text',
461
+ get_by_mask: 'text',
462
+ get_mask_by_name: 'text'
463
+ }
464
+ },
465
+ limits_module: {
466
+ schema: 'metaschema_modules_public',
467
+ table: 'limits_module',
468
+ fields: {
469
+ id: 'uuid',
470
+ database_id: 'uuid',
471
+ schema_id: 'uuid',
472
+ private_schema_id: 'uuid',
473
+ table_id: 'uuid',
474
+ table_name: 'text',
475
+ default_table_id: 'uuid',
476
+ default_table_name: 'text',
477
+ limit_increment_function: 'text',
478
+ limit_decrement_function: 'text',
479
+ limit_increment_trigger: 'text',
480
+ limit_decrement_trigger: 'text',
481
+ limit_update_trigger: 'text',
482
+ limit_check_function: 'text',
483
+ prefix: 'text',
484
+ membership_type: 'int',
485
+ entity_table_id: 'uuid',
486
+ actor_table_id: 'uuid'
487
+ }
488
+ },
489
+ levels_module: {
490
+ schema: 'metaschema_modules_public',
491
+ table: 'levels_module',
492
+ fields: {
493
+ id: 'uuid',
494
+ database_id: 'uuid',
495
+ schema_id: 'uuid',
496
+ private_schema_id: 'uuid',
497
+ steps_table_id: 'uuid',
498
+ steps_table_name: 'text',
499
+ achievements_table_id: 'uuid',
500
+ achievements_table_name: 'text',
501
+ levels_table_id: 'uuid',
502
+ levels_table_name: 'text',
503
+ level_requirements_table_id: 'uuid',
504
+ level_requirements_table_name: 'text',
505
+ completed_step: 'text',
506
+ incompleted_step: 'text',
507
+ tg_achievement: 'text',
508
+ tg_achievement_toggle: 'text',
509
+ tg_achievement_toggle_boolean: 'text',
510
+ tg_achievement_boolean: 'text',
511
+ upsert_achievement: 'text',
512
+ tg_update_achievements: 'text',
513
+ steps_required: 'text',
514
+ level_achieved: 'text',
515
+ prefix: 'text',
516
+ membership_type: 'int',
517
+ entity_table_id: 'uuid',
518
+ actor_table_id: 'uuid'
519
+ }
520
+ },
521
+ users_module: {
522
+ schema: 'metaschema_modules_public',
523
+ table: 'users_module',
524
+ fields: {
525
+ id: 'uuid',
526
+ database_id: 'uuid',
527
+ schema_id: 'uuid',
528
+ table_id: 'uuid',
529
+ table_name: 'text',
530
+ type_table_id: 'uuid',
531
+ type_table_name: 'text'
532
+ }
533
+ },
534
+ hierarchy_module: {
535
+ schema: 'metaschema_modules_public',
536
+ table: 'hierarchy_module',
537
+ fields: {
538
+ id: 'uuid',
539
+ database_id: 'uuid',
540
+ schema_id: 'uuid',
541
+ private_schema_id: 'uuid',
542
+ chart_edges_table_id: 'uuid',
543
+ chart_edges_table_name: 'text',
544
+ hierarchy_sprt_table_id: 'uuid',
545
+ hierarchy_sprt_table_name: 'text',
546
+ chart_edge_grants_table_id: 'uuid',
547
+ chart_edge_grants_table_name: 'text',
548
+ entity_table_id: 'uuid',
549
+ users_table_id: 'uuid',
550
+ prefix: 'text',
551
+ private_schema_name: 'text',
552
+ sprt_table_name: 'text',
553
+ rebuild_hierarchy_function: 'text',
554
+ get_subordinates_function: 'text',
555
+ get_managers_function: 'text',
556
+ is_manager_of_function: 'text',
557
+ created_at: 'timestamptz'
558
+ }
559
+ },
560
+ membership_types_module: {
561
+ schema: 'metaschema_modules_public',
562
+ table: 'membership_types_module',
563
+ fields: {
564
+ id: 'uuid',
565
+ database_id: 'uuid',
566
+ schema_id: 'uuid',
567
+ table_id: 'uuid',
568
+ table_name: 'text'
569
+ }
570
+ },
571
+ invites_module: {
572
+ schema: 'metaschema_modules_public',
573
+ table: 'invites_module',
574
+ fields: {
575
+ id: 'uuid',
576
+ database_id: 'uuid',
577
+ schema_id: 'uuid',
578
+ private_schema_id: 'uuid',
579
+ emails_table_id: 'uuid',
580
+ users_table_id: 'uuid',
581
+ invites_table_id: 'uuid',
582
+ claimed_invites_table_id: 'uuid',
583
+ invites_table_name: 'text',
584
+ claimed_invites_table_name: 'text',
585
+ submit_invite_code_function: 'text',
586
+ prefix: 'text',
587
+ membership_type: 'int',
588
+ entity_table_id: 'uuid'
589
+ }
590
+ },
591
+ emails_module: {
592
+ schema: 'metaschema_modules_public',
593
+ table: 'emails_module',
594
+ fields: {
595
+ id: 'uuid',
596
+ database_id: 'uuid',
597
+ schema_id: 'uuid',
598
+ private_schema_id: 'uuid',
599
+ table_id: 'uuid',
600
+ owner_table_id: 'uuid',
601
+ table_name: 'text'
602
+ }
603
+ },
604
+ tokens_module: {
605
+ schema: 'metaschema_modules_public',
606
+ table: 'tokens_module',
607
+ fields: {
608
+ id: 'uuid',
609
+ database_id: 'uuid',
610
+ schema_id: 'uuid',
611
+ table_id: 'uuid',
612
+ owned_table_id: 'uuid',
613
+ tokens_default_expiration: 'interval',
614
+ tokens_table: 'text'
615
+ }
616
+ },
617
+ secrets_module: {
618
+ schema: 'metaschema_modules_public',
619
+ table: 'secrets_module',
620
+ fields: {
621
+ id: 'uuid',
622
+ database_id: 'uuid',
623
+ schema_id: 'uuid',
624
+ table_id: 'uuid',
625
+ table_name: 'text'
626
+ }
627
+ },
628
+ profiles_module: {
629
+ schema: 'metaschema_modules_public',
630
+ table: 'profiles_module',
631
+ fields: {
632
+ id: 'uuid',
633
+ database_id: 'uuid',
634
+ schema_id: 'uuid',
635
+ private_schema_id: 'uuid',
636
+ table_id: 'uuid',
637
+ table_name: 'text',
638
+ profile_permissions_table_id: 'uuid',
639
+ profile_permissions_table_name: 'text',
640
+ profile_grants_table_id: 'uuid',
641
+ profile_grants_table_name: 'text',
642
+ profile_definition_grants_table_id: 'uuid',
643
+ profile_definition_grants_table_name: 'text',
644
+ bitlen: 'int',
645
+ membership_type: 'int',
646
+ entity_table_id: 'uuid',
647
+ actor_table_id: 'uuid',
648
+ permissions_table_id: 'uuid',
649
+ memberships_table_id: 'uuid',
650
+ prefix: 'text'
651
+ }
652
+ },
653
+ encrypted_secrets_module: {
654
+ schema: 'metaschema_modules_public',
655
+ table: 'encrypted_secrets_module',
656
+ fields: {
657
+ id: 'uuid',
658
+ database_id: 'uuid',
659
+ schema_id: 'uuid',
660
+ table_id: 'uuid',
661
+ table_name: 'text'
662
+ }
663
+ },
664
+ connected_accounts_module: {
665
+ schema: 'metaschema_modules_public',
666
+ table: 'connected_accounts_module',
667
+ fields: {
668
+ id: 'uuid',
669
+ database_id: 'uuid',
670
+ schema_id: 'uuid',
671
+ private_schema_id: 'uuid',
672
+ table_id: 'uuid',
673
+ owner_table_id: 'uuid',
674
+ table_name: 'text'
675
+ }
676
+ },
677
+ phone_numbers_module: {
678
+ schema: 'metaschema_modules_public',
679
+ table: 'phone_numbers_module',
680
+ fields: {
681
+ id: 'uuid',
682
+ database_id: 'uuid',
683
+ schema_id: 'uuid',
684
+ private_schema_id: 'uuid',
685
+ table_id: 'uuid',
686
+ owner_table_id: 'uuid',
687
+ table_name: 'text'
688
+ }
689
+ },
690
+ crypto_addresses_module: {
691
+ schema: 'metaschema_modules_public',
692
+ table: 'crypto_addresses_module',
693
+ fields: {
694
+ id: 'uuid',
695
+ database_id: 'uuid',
696
+ schema_id: 'uuid',
697
+ private_schema_id: 'uuid',
698
+ table_id: 'uuid',
699
+ owner_table_id: 'uuid',
700
+ table_name: 'text',
701
+ crypto_network: 'text'
702
+ }
703
+ },
704
+ crypto_auth_module: {
705
+ schema: 'metaschema_modules_public',
706
+ table: 'crypto_auth_module',
707
+ fields: {
708
+ id: 'uuid',
709
+ database_id: 'uuid',
710
+ schema_id: 'uuid',
711
+ users_table_id: 'uuid',
712
+ tokens_table_id: 'uuid',
713
+ secrets_table_id: 'uuid',
714
+ addresses_table_id: 'uuid',
715
+ user_field: 'text',
716
+ crypto_network: 'text',
717
+ sign_in_request_challenge: 'text',
718
+ sign_in_record_failure: 'text',
719
+ sign_up_with_key: 'text',
720
+ sign_in_with_challenge: 'text'
721
+ }
722
+ },
723
+ field_module: {
724
+ schema: 'metaschema_modules_public',
725
+ table: 'field_module',
726
+ fields: {
727
+ id: 'uuid',
728
+ database_id: 'uuid',
729
+ private_schema_id: 'uuid',
730
+ table_id: 'uuid',
731
+ field_id: 'uuid',
732
+ data: 'jsonb',
733
+ triggers: 'text[]',
734
+ functions: 'text[]'
735
+ }
736
+ },
737
+ uuid_module: {
738
+ schema: 'metaschema_modules_public',
739
+ table: 'uuid_module',
740
+ fields: {
741
+ id: 'uuid',
742
+ database_id: 'uuid',
743
+ schema_id: 'uuid',
744
+ uuid_function: 'text',
745
+ uuid_seed: 'text'
746
+ }
747
+ },
748
+ default_ids_module: {
749
+ schema: 'metaschema_modules_public',
750
+ table: 'default_ids_module',
751
+ fields: {
752
+ id: 'uuid',
753
+ database_id: 'uuid'
754
+ }
755
+ },
756
+ denormalized_table_field: {
757
+ schema: 'metaschema_modules_public',
758
+ table: 'denormalized_table_field',
759
+ fields: {
760
+ id: 'uuid',
761
+ database_id: 'uuid',
762
+ table_id: 'uuid',
763
+ field_id: 'uuid',
764
+ set_ids: 'uuid[]',
765
+ ref_table_id: 'uuid',
766
+ ref_field_id: 'uuid',
767
+ ref_ids: 'uuid[]',
768
+ use_updates: 'boolean',
769
+ update_defaults: 'boolean',
770
+ func_name: 'text',
771
+ func_order: 'int'
772
+ }
209
773
  }
210
774
  };
211
775
  const exportMeta = async ({ opts, dbname, database_id }) => {
@@ -219,30 +783,85 @@ const exportMeta = async ({ opts, dbname, database_id }) => {
219
783
  return m;
220
784
  }, {});
221
785
  const queryAndParse = async (key, query) => {
222
- const result = await pool.query(query, [database_id]);
223
- if (result.rows.length) {
224
- const parsed = await parsers[key].parse(result.rows);
225
- if (parsed) {
226
- sql[key] = parsed;
786
+ try {
787
+ const result = await pool.query(query, [database_id]);
788
+ if (result.rows.length) {
789
+ const parsed = await parsers[key].parse(result.rows);
790
+ if (parsed) {
791
+ sql[key] = parsed;
792
+ }
227
793
  }
228
794
  }
795
+ catch (err) {
796
+ const pgError = err;
797
+ if (pgError.code === '42P01') {
798
+ return;
799
+ }
800
+ throw err;
801
+ }
229
802
  };
803
+ // =============================================================================
804
+ // metaschema_public tables
805
+ // =============================================================================
230
806
  await queryAndParse('database', `SELECT * FROM metaschema_public.database WHERE id = $1`);
807
+ await queryAndParse('database_extension', `SELECT * FROM metaschema_public.database_extension WHERE database_id = $1`);
231
808
  await queryAndParse('schema', `SELECT * FROM metaschema_public.schema WHERE database_id = $1`);
232
809
  await queryAndParse('table', `SELECT * FROM metaschema_public.table WHERE database_id = $1`);
233
810
  await queryAndParse('field', `SELECT * FROM metaschema_public.field WHERE database_id = $1`);
811
+ await queryAndParse('policy', `SELECT * FROM metaschema_public.policy WHERE database_id = $1`);
812
+ await queryAndParse('index', `SELECT * FROM metaschema_public.index WHERE database_id = $1`);
813
+ await queryAndParse('trigger', `SELECT * FROM metaschema_public.trigger WHERE database_id = $1`);
814
+ await queryAndParse('trigger_function', `SELECT * FROM metaschema_public.trigger_function WHERE database_id = $1`);
815
+ await queryAndParse('rls_function', `SELECT * FROM metaschema_public.rls_function WHERE database_id = $1`);
816
+ await queryAndParse('limit_function', `SELECT * FROM metaschema_public.limit_function WHERE database_id = $1`);
817
+ await queryAndParse('procedure', `SELECT * FROM metaschema_public.procedure WHERE database_id = $1`);
818
+ await queryAndParse('foreign_key_constraint', `SELECT * FROM metaschema_public.foreign_key_constraint WHERE database_id = $1`);
819
+ await queryAndParse('primary_key_constraint', `SELECT * FROM metaschema_public.primary_key_constraint WHERE database_id = $1`);
820
+ await queryAndParse('unique_constraint', `SELECT * FROM metaschema_public.unique_constraint WHERE database_id = $1`);
821
+ await queryAndParse('check_constraint', `SELECT * FROM metaschema_public.check_constraint WHERE database_id = $1`);
822
+ await queryAndParse('full_text_search', `SELECT * FROM metaschema_public.full_text_search WHERE database_id = $1`);
823
+ await queryAndParse('schema_grant', `SELECT * FROM metaschema_public.schema_grant WHERE database_id = $1`);
824
+ await queryAndParse('table_grant', `SELECT * FROM metaschema_public.table_grant WHERE database_id = $1`);
825
+ await queryAndParse('extension', `SELECT * FROM metaschema_public.extension`);
826
+ // =============================================================================
827
+ // services_public tables
828
+ // =============================================================================
234
829
  await queryAndParse('domains', `SELECT * FROM services_public.domains WHERE database_id = $1`);
235
- await queryAndParse('apis', `SELECT * FROM services_public.apis WHERE database_id = $1`);
236
830
  await queryAndParse('sites', `SELECT * FROM services_public.sites WHERE database_id = $1`);
237
- await queryAndParse('api_modules', `SELECT * FROM services_public.api_modules WHERE database_id = $1`);
831
+ await queryAndParse('apis', `SELECT * FROM services_public.apis WHERE database_id = $1`);
832
+ await queryAndParse('apps', `SELECT * FROM services_public.apps WHERE database_id = $1`);
238
833
  await queryAndParse('site_modules', `SELECT * FROM services_public.site_modules WHERE database_id = $1`);
239
834
  await queryAndParse('site_themes', `SELECT * FROM services_public.site_themes WHERE database_id = $1`);
240
- await queryAndParse('apps', `SELECT * FROM services_public.apps WHERE database_id = $1`);
241
- await queryAndParse('database_extension', `SELECT * FROM metaschema_public.database_extension WHERE database_id = $1`);
835
+ await queryAndParse('site_metadata', `SELECT * FROM services_public.site_metadata WHERE database_id = $1`);
836
+ await queryAndParse('api_modules', `SELECT * FROM services_public.api_modules WHERE database_id = $1`);
242
837
  await queryAndParse('api_extensions', `SELECT * FROM services_public.api_extensions WHERE database_id = $1`);
243
838
  await queryAndParse('api_schemata', `SELECT * FROM services_public.api_schemata WHERE database_id = $1`);
839
+ // =============================================================================
840
+ // metaschema_modules_public tables
841
+ // =============================================================================
244
842
  await queryAndParse('rls_module', `SELECT * FROM metaschema_modules_public.rls_module WHERE database_id = $1`);
245
843
  await queryAndParse('user_auth_module', `SELECT * FROM metaschema_modules_public.user_auth_module WHERE database_id = $1`);
844
+ await queryAndParse('memberships_module', `SELECT * FROM metaschema_modules_public.memberships_module WHERE database_id = $1`);
845
+ await queryAndParse('permissions_module', `SELECT * FROM metaschema_modules_public.permissions_module WHERE database_id = $1`);
846
+ await queryAndParse('limits_module', `SELECT * FROM metaschema_modules_public.limits_module WHERE database_id = $1`);
847
+ await queryAndParse('levels_module', `SELECT * FROM metaschema_modules_public.levels_module WHERE database_id = $1`);
848
+ await queryAndParse('users_module', `SELECT * FROM metaschema_modules_public.users_module WHERE database_id = $1`);
849
+ await queryAndParse('hierarchy_module', `SELECT * FROM metaschema_modules_public.hierarchy_module WHERE database_id = $1`);
850
+ await queryAndParse('membership_types_module', `SELECT * FROM metaschema_modules_public.membership_types_module WHERE database_id = $1`);
851
+ await queryAndParse('invites_module', `SELECT * FROM metaschema_modules_public.invites_module WHERE database_id = $1`);
852
+ await queryAndParse('emails_module', `SELECT * FROM metaschema_modules_public.emails_module WHERE database_id = $1`);
853
+ await queryAndParse('tokens_module', `SELECT * FROM metaschema_modules_public.tokens_module WHERE database_id = $1`);
854
+ await queryAndParse('secrets_module', `SELECT * FROM metaschema_modules_public.secrets_module WHERE database_id = $1`);
855
+ await queryAndParse('profiles_module', `SELECT * FROM metaschema_modules_public.profiles_module WHERE database_id = $1`);
856
+ await queryAndParse('encrypted_secrets_module', `SELECT * FROM metaschema_modules_public.encrypted_secrets_module WHERE database_id = $1`);
857
+ await queryAndParse('connected_accounts_module', `SELECT * FROM metaschema_modules_public.connected_accounts_module WHERE database_id = $1`);
858
+ await queryAndParse('phone_numbers_module', `SELECT * FROM metaschema_modules_public.phone_numbers_module WHERE database_id = $1`);
859
+ await queryAndParse('crypto_addresses_module', `SELECT * FROM metaschema_modules_public.crypto_addresses_module WHERE database_id = $1`);
860
+ await queryAndParse('crypto_auth_module', `SELECT * FROM metaschema_modules_public.crypto_auth_module WHERE database_id = $1`);
861
+ await queryAndParse('field_module', `SELECT * FROM metaschema_modules_public.field_module WHERE database_id = $1`);
862
+ await queryAndParse('uuid_module', `SELECT * FROM metaschema_modules_public.uuid_module WHERE database_id = $1`);
863
+ await queryAndParse('default_ids_module', `SELECT * FROM metaschema_modules_public.default_ids_module WHERE database_id = $1`);
864
+ await queryAndParse('denormalized_table_field', `SELECT * FROM metaschema_modules_public.denormalized_table_field WHERE database_id = $1`);
246
865
  return Object.entries(sql).reduce((m, [_, v]) => m + '\n\n' + v, '');
247
866
  };
248
867
  exports.exportMeta = exportMeta;