Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pgpm/export/src/export-graphql-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ export const exportGraphQLMeta = async ({
queryAndParse('site_metadata'),
queryAndParse('api_modules'),
queryAndParse('api_extensions'),
queryAndParse('api_schemas')
queryAndParse('api_schemas'),
queryAndParse('database_settings'),
queryAndParse('api_settings'),
queryAndParse('rls_settings'),
queryAndParse('cors_settings'),
queryAndParse('pubkey_settings'),
queryAndParse('webauthn_settings')
]);

// metaschema_modules_public tables
Expand Down
6 changes: 6 additions & 0 deletions pgpm/export/src/export-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ export const exportMeta = async ({ opts, dbname, database_id }: ExportMetaParams
await queryAndParse('api_modules', `SELECT * FROM services_public.api_modules WHERE database_id = $1 ORDER BY id`);
await queryAndParse('api_extensions', `SELECT * FROM services_public.api_extensions WHERE database_id = $1 ORDER BY id`);
await queryAndParse('api_schemas', `SELECT * FROM services_public.api_schemas WHERE database_id = $1 ORDER BY id`);
await queryAndParse('database_settings', `SELECT * FROM services_public.database_settings WHERE database_id = $1 ORDER BY id`);
await queryAndParse('api_settings', `SELECT * FROM services_public.api_settings WHERE database_id = $1 ORDER BY id`);
await queryAndParse('rls_settings', `SELECT * FROM services_public.rls_settings WHERE database_id = $1 ORDER BY id`);
await queryAndParse('cors_settings', `SELECT * FROM services_public.cors_settings WHERE database_id = $1 ORDER BY id`);
await queryAndParse('pubkey_settings', `SELECT * FROM services_public.pubkey_settings WHERE database_id = $1 ORDER BY id`);
await queryAndParse('webauthn_settings', `SELECT * FROM services_public.webauthn_settings WHERE database_id = $1 ORDER BY id`);

// =============================================================================
// metaschema_modules_public tables
Expand Down
108 changes: 108 additions & 0 deletions pgpm/export/src/export-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ export const META_TABLE_ORDER = [
'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',
Expand Down Expand Up @@ -559,6 +565,108 @@ export const META_TABLE_CONFIG: Record<string, TableConfig> = {
api_id: 'uuid'
}
},
database_settings: {
schema: 'services_public',
table: 'database_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
enable_aggregates: 'boolean',
enable_postgis: 'boolean',
enable_search: 'boolean',
enable_direct_uploads: 'boolean',
enable_presigned_uploads: 'boolean',
enable_many_to_many: 'boolean',
enable_connection_filter: 'boolean',
enable_ltree: 'boolean',
enable_llm: 'boolean',
options: 'jsonb'
}
},
api_settings: {
schema: 'services_public',
table: 'api_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
api_id: 'uuid',
enable_aggregates: 'boolean',
enable_postgis: 'boolean',
enable_search: 'boolean',
enable_direct_uploads: 'boolean',
enable_presigned_uploads: 'boolean',
enable_many_to_many: 'boolean',
enable_connection_filter: 'boolean',
enable_ltree: 'boolean',
enable_llm: 'boolean',
options: 'jsonb'
}
},
rls_settings: {
schema: 'services_public',
table: 'rls_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
authenticate_schema_id: 'uuid',
role_schema_id: 'uuid',
authenticate_function_id: 'uuid',
authenticate_strict_function_id: 'uuid',
current_role_function_id: 'uuid',
current_role_id_function_id: 'uuid',
current_user_agent_function_id: 'uuid',
current_ip_address_function_id: 'uuid'
}
},
cors_settings: {
schema: 'services_public',
table: 'cors_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
api_id: 'uuid',
allowed_origins: 'text[]'
}
},
pubkey_settings: {
schema: 'services_public',
table: 'pubkey_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
crypto_network: 'text',
user_field: 'text',
sign_up_with_key_function_id: 'uuid',
sign_in_request_challenge_function_id: 'uuid',
sign_in_record_failure_function_id: 'uuid',
sign_in_with_challenge_function_id: 'uuid'
}
},
webauthn_settings: {
schema: 'services_public',
table: 'webauthn_settings',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
credentials_schema_id: 'uuid',
sessions_schema_id: 'uuid',
session_secrets_schema_id: 'uuid',
credentials_table_id: 'uuid',
sessions_table_id: 'uuid',
session_credentials_table_id: 'uuid',
session_secrets_table_id: 'uuid',
user_field_id: 'uuid',
rp_id: 'text',
rp_name: 'text',
origin_allowlist: 'text[]',
attestation_type: 'text',
require_user_verification: 'boolean',
resident_key: 'text',
challenge_expiry_seconds: 'int'
}
},
// =============================================================================
// metaschema_modules_public tables
// =============================================================================
Expand Down
Loading