@pgpmjs/export 0.12.0 → 0.12.3

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.
@@ -89,6 +89,7 @@ export const exportGraphQLMeta = async ({ client, database_id }) => {
89
89
  queryAndParse('database'),
90
90
  queryAndParse('database_extension'),
91
91
  queryAndParse('schema'),
92
+ queryAndParse('function'),
92
93
  queryAndParse('table'),
93
94
  queryAndParse('field'),
94
95
  queryAndParse('policy'),
@@ -101,6 +101,7 @@ export const exportMeta = async ({ opts, dbname, database_id }) => {
101
101
  await queryAndParse('database', `SELECT * FROM metaschema_public.database WHERE id = $1 ORDER BY id`);
102
102
  await queryAndParse('database_extension', `SELECT * FROM metaschema_public.database_extension WHERE database_id = $1 ORDER BY id`);
103
103
  await queryAndParse('schema', `SELECT * FROM metaschema_public.schema WHERE database_id = $1 ORDER BY id`);
104
+ await queryAndParse('function', `SELECT * FROM metaschema_public.function WHERE database_id = $1 ORDER BY id`);
104
105
  await queryAndParse('table', `SELECT * FROM metaschema_public.table WHERE database_id = $1 ORDER BY id`);
105
106
  await queryAndParse('field', `SELECT * FROM metaschema_public.field WHERE database_id = $1 ORDER BY id`);
106
107
  await queryAndParse('policy', `SELECT * FROM metaschema_public.policy WHERE database_id = $1 ORDER BY id`);
@@ -115,6 +115,7 @@ SET session_replication_role TO DEFAULT;`;
115
115
  export const META_TABLE_ORDER = [
116
116
  'database',
117
117
  'schema',
118
+ 'function',
118
119
  'table',
119
120
  'field',
120
121
  'policy',
@@ -220,6 +221,16 @@ export const META_TABLE_CONFIG = {
220
221
  is_public: 'boolean'
221
222
  }
222
223
  },
224
+ function: {
225
+ schema: 'metaschema_public',
226
+ table: 'function',
227
+ fields: {
228
+ id: 'uuid',
229
+ database_id: 'uuid',
230
+ schema_id: 'uuid',
231
+ name: 'text'
232
+ }
233
+ },
223
234
  table: {
224
235
  schema: 'metaschema_public',
225
236
  table: 'table',
@@ -92,6 +92,7 @@ const exportGraphQLMeta = async ({ client, database_id }) => {
92
92
  queryAndParse('database'),
93
93
  queryAndParse('database_extension'),
94
94
  queryAndParse('schema'),
95
+ queryAndParse('function'),
95
96
  queryAndParse('table'),
96
97
  queryAndParse('field'),
97
98
  queryAndParse('policy'),
package/export-meta.js CHANGED
@@ -104,6 +104,7 @@ const exportMeta = async ({ opts, dbname, database_id }) => {
104
104
  await queryAndParse('database', `SELECT * FROM metaschema_public.database WHERE id = $1 ORDER BY id`);
105
105
  await queryAndParse('database_extension', `SELECT * FROM metaschema_public.database_extension WHERE database_id = $1 ORDER BY id`);
106
106
  await queryAndParse('schema', `SELECT * FROM metaschema_public.schema WHERE database_id = $1 ORDER BY id`);
107
+ await queryAndParse('function', `SELECT * FROM metaschema_public.function WHERE database_id = $1 ORDER BY id`);
107
108
  await queryAndParse('table', `SELECT * FROM metaschema_public.table WHERE database_id = $1 ORDER BY id`);
108
109
  await queryAndParse('field', `SELECT * FROM metaschema_public.field WHERE database_id = $1 ORDER BY id`);
109
110
  await queryAndParse('policy', `SELECT * FROM metaschema_public.policy WHERE database_id = $1 ORDER BY id`);
package/export-utils.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare const META_COMMON_FOOTER = "\nSET session_replication_role TO DEF
23
23
  * Ordered list of meta tables for export.
24
24
  * Tables are processed in this order to satisfy foreign key dependencies.
25
25
  */
26
- export declare const META_TABLE_ORDER: readonly ["database", "schema", "table", "field", "policy", "index", "trigger", "trigger_function", "rls_function", "foreign_key_constraint", "primary_key_constraint", "unique_constraint", "check_constraint", "full_text_search", "schema_grant", "table_grant", "default_privilege", "domains", "sites", "apis", "apps", "site_modules", "site_themes", "site_metadata", "api_modules", "api_extensions", "api_schemas", "database_settings", "api_settings", "rls_settings", "cors_settings", "pubkey_settings", "webauthn_settings", "rls_module", "user_auth_module", "memberships_module", "permissions_module", "limits_module", "levels_module", "users_module", "hierarchy_module", "membership_types_module", "invites_module", "emails_module", "sessions_module", "secrets_module", "profiles_module", "encrypted_secrets_module", "connected_accounts_module", "phone_numbers_module", "crypto_addresses_module", "crypto_auth_module", "field_module", "table_module", "secure_table_provision", "uuid_module", "default_ids_module", "denormalized_table_field", "table_template_module"];
26
+ export declare const META_TABLE_ORDER: readonly ["database", "schema", "function", "table", "field", "policy", "index", "trigger", "trigger_function", "rls_function", "foreign_key_constraint", "primary_key_constraint", "unique_constraint", "check_constraint", "full_text_search", "schema_grant", "table_grant", "default_privilege", "domains", "sites", "apis", "apps", "site_modules", "site_themes", "site_metadata", "api_modules", "api_extensions", "api_schemas", "database_settings", "api_settings", "rls_settings", "cors_settings", "pubkey_settings", "webauthn_settings", "rls_module", "user_auth_module", "memberships_module", "permissions_module", "limits_module", "levels_module", "users_module", "hierarchy_module", "membership_types_module", "invites_module", "emails_module", "sessions_module", "secrets_module", "profiles_module", "encrypted_secrets_module", "connected_accounts_module", "phone_numbers_module", "crypto_addresses_module", "crypto_auth_module", "field_module", "table_module", "secure_table_provision", "uuid_module", "default_ids_module", "denormalized_table_field", "table_template_module"];
27
27
  export type FieldType = 'uuid' | 'uuid[]' | 'text' | 'text[]' | 'boolean' | 'image' | 'upload' | 'url' | 'jsonb' | 'jsonb[]' | 'int' | 'interval' | 'timestamptz';
28
28
  export interface TableConfig {
29
29
  schema: string;
package/export-utils.js CHANGED
@@ -121,6 +121,7 @@ SET session_replication_role TO DEFAULT;`;
121
121
  exports.META_TABLE_ORDER = [
122
122
  'database',
123
123
  'schema',
124
+ 'function',
124
125
  'table',
125
126
  'field',
126
127
  'policy',
@@ -226,6 +227,16 @@ exports.META_TABLE_CONFIG = {
226
227
  is_public: 'boolean'
227
228
  }
228
229
  },
230
+ function: {
231
+ schema: 'metaschema_public',
232
+ table: 'function',
233
+ fields: {
234
+ id: 'uuid',
235
+ database_id: 'uuid',
236
+ schema_id: 'uuid',
237
+ name: 'text'
238
+ }
239
+ },
229
240
  table: {
230
241
  schema: 'metaschema_public',
231
242
  table: 'table',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/export",
3
- "version": "0.12.0",
3
+ "version": "0.12.3",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM export tools for SQL and GraphQL database migration extraction",
6
6
  "main": "index.js",
@@ -41,19 +41,19 @@
41
41
  "@pgsql/types": "^17.6.2",
42
42
  "@types/pg": "^8.18.0",
43
43
  "makage": "^0.3.0",
44
- "pgsql-test": "^4.13.0"
44
+ "pgsql-test": "^4.13.1"
45
45
  },
46
46
  "dependencies": {
47
- "@pgpmjs/core": "^6.17.0",
48
- "@pgpmjs/migrate-client": "^0.12.0",
49
- "@pgpmjs/types": "^2.26.0",
50
- "csv-to-pg": "^3.16.0",
47
+ "@pgpmjs/core": "^6.17.1",
48
+ "@pgpmjs/migrate-client": "^0.12.3",
49
+ "@pgpmjs/types": "^2.26.1",
50
+ "csv-to-pg": "^3.16.1",
51
51
  "glob": "^13.0.6",
52
52
  "inflekt": "^0.7.1",
53
53
  "inquirerer": "^4.7.0",
54
54
  "pg": "^8.20.0",
55
- "pg-cache": "^3.9.0",
56
- "pg-env": "^1.13.0"
55
+ "pg-cache": "^3.9.1",
56
+ "pg-env": "^1.13.1"
57
57
  },
58
- "gitHead": "c665e2443ec98da61e9f372cf663cb9973afef4b"
58
+ "gitHead": "a4774481064e5cc16ca64f83cd705931e2b58250"
59
59
  }