better-supabase 0.18.0 → 0.18.2
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.
- package/dist/{app-tables-XwCviyhP.d.ts → app-tables-atP-tZKZ.d.ts} +1 -1
- package/dist/blocks/audit/index.d.ts +1 -1
- package/dist/cli/{add-B1S3yK4L.js → add-CbUFLPVA.js} +9 -9
- package/dist/cli/{add-D7YIXslp.js → add-ee805E_R.js} +2 -2
- package/dist/cli/add-k8gdux-e.js +1 -0
- package/dist/cli/{backfill-BwkyNhlC.js → backfill-CCNXzDjt.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-DDm1Zc2S.js → blocks-CKp4EfLe.js} +1 -1
- package/dist/cli/{blocks-CBqENu3C.js → blocks-DNgcfS8X.js} +1 -1
- package/dist/cli/{cache-DE2IH1-C.js → cache-CDNVq1vO.js} +1 -1
- package/dist/cli/{codemod-OHKhVV-v.js → codemod-B621vQYQ.js} +2 -2
- package/dist/cli/{content-mapper-CaygHH_k.js → content-mapper-Chm3txER.js} +2 -2
- package/dist/cli/{doctor-D_nrsd9E.js → doctor-EWtWH8I9.js} +15 -15
- package/dist/cli/{gen-D7gMEwvg.js → gen-D-g9TAmr.js} +11 -11
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{init-ch-HWJyp.js → init-D0SxtKH5.js} +5 -5
- package/dist/cli/{legacy-prefix-DkTA3Rhx.js → legacy-prefix-R7UChFFl.js} +18 -5
- package/dist/cli/{live-B38ePuRS.js → live-PaO1MC10.js} +2 -2
- package/dist/cli/{mcp-P9RP2SJ3.js → mcp-CHpzdlOg.js} +2 -2
- package/dist/cli/{metadata-BTihErEc.js → metadata-KKCdxMLb.js} +3 -3
- package/dist/cli/{migration-safety-DYo1vVWC.js → migration-safety-Cgr44KLM.js} +1 -1
- package/dist/cli/{migrations-BoIyGczt.js → migrations-VmJloDtq.js} +1 -1
- package/dist/cli/{module-migration-DXvo0EqU.js → module-migration-D4lirR47.js} +2 -2
- package/dist/cli/powersync-Bo16K2S6.js +1 -0
- package/dist/cli/{powersync-D-0yV_L_.js → powersync-Cc9Ad_Mn.js} +2 -2
- package/dist/cli/{print-CRon4lXf.js → print-CXmXGe3Y.js} +2 -2
- package/dist/cli/{remove-D89s99ha.js → remove-CJi3fvpP.js} +5 -5
- package/dist/cli/{render-BJF9ytUi.js → render-CVTKsacY.js} +3 -3
- package/dist/cli/{run-x9ZY4Tm0.js → run-DvK2vagi.js} +21 -21
- package/dist/cli/{run-jeplMBOK.js → run-x9l841K2.js} +8 -8
- package/dist/cli/{shared-B38Chjgd.js → shared-FhGSrA9E.js} +1 -1
- package/dist/cli/{snapshot-BXmU3IXN.js → snapshot-B12QpZNf.js} +2 -2
- package/dist/cli/{source-irttnsEb.js → source-DP8KOgax.js} +1 -1
- package/dist/cli/{spec-DzD5wMVF.js → spec-CIQBAQgr.js} +1 -1
- package/dist/cli/{spec-CDxfokey.js → spec-D-NPgLTj.js} +2 -2
- package/dist/cli/{sql-layout-D8QrNvt4.js → sql-layout-DTczUfCt.js} +2 -2
- package/dist/cli/{sync-s1iKFIos.js → sync-DHJ6UBod.js} +3 -3
- package/dist/cli/{upgrade-B4FPlK-_.js → upgrade-B69K7-JE.js} +5 -5
- package/dist/cli/{upgrade-CluxP3JJ.js → upgrade-C7SEKT4b.js} +2 -2
- package/dist/cli/{version-TgFM8sOd.js → version-DmaGTP3L.js} +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/{context-D24k1Cpc.d.ts → context-Cj-9gE6l.d.ts} +4 -2
- package/dist/create/index.d.ts +2 -2
- package/dist/create/index.js +1 -1
- package/dist/{field-errors-DucQdLl7.d.ts → field-errors-DkAemDoc.d.ts} +1 -1
- package/dist/{index-XAyzdLns.d.ts → index-DTbJAsrT.d.ts} +2 -2
- package/dist/{index-BAcQz5DS.d.ts → index-DVYEoVMK.d.ts} +1 -1
- package/dist/{index-4WT_uRRL.d.ts → index-DZylLz7h.d.ts} +1 -1
- package/dist/{index-BH3NYExp.d.ts → index-DmbCyl6Z.d.ts} +7 -3
- package/dist/mapper/bin.js +5 -5
- package/dist/next/index.d.ts +1 -1
- package/dist/otel/index.js +4 -4
- package/dist/preset/index.d.ts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +1 -1
- package/dist/react/server.d.ts +3 -3
- package/dist/react/server.js +1 -1
- package/dist/{react-CZUZYn9E.js → react-zBTxLsV6.js} +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/realtime/index.js +1 -1
- package/dist/{relay-gKvKJ3xf.js → relay-CIKcAVjf.js} +61 -21
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.js +11 -4
- package/dist/solid/index.d.ts +1 -1
- package/dist/sql/index.d.ts +3 -3
- package/dist/sql/index.js +1 -1
- package/dist/{sql-fHTjZGqR.js → sql-D2Sc6BTr.js} +39 -10
- package/dist/svelte/index.d.ts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/vue/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cli/add-BQPJnapO.js +0 -1
- package/dist/cli/powersync-DXVsKkAu.js +0 -1
package/dist/solid/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceM
|
|
|
6
6
|
import { t as AuthSnapshot } from "../bind-pu5TLrla.js";
|
|
7
7
|
import { t as AuthSession } from "../view-DyFdMCqg.js";
|
|
8
8
|
import { n as Controller } from "../controller-BR7CZ1R9.js";
|
|
9
|
-
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-
|
|
9
|
+
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DkAemDoc.js";
|
|
10
10
|
import { n as BlockOptions } from "../block-env-CA65ulTD.js";
|
|
11
11
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
|
|
12
12
|
import { t as SupportView } from "../support-view-BYOgwXsJ.js";
|
package/dist/sql/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { M as BlockOptionsRegistry, j as BLOCK_OPTION_SCHEMAS, k as resolveBlock } from "../authorization-IiE__z2m.js";
|
|
2
|
-
import { C as OwnView, Qn as auditRegistrations, S as BlockSqlUpgrade, T as notNullCheckName, Xn as sameTenantLayout, Yn as DeclaredForeignKey, Zn as AuditedTable, _ as BlockSqlDeprecation, a as BlockSqlContext, b as BlockSqlLayout, c as BlockSqlIdType, d as MODULE_ID_TYPES, f as contractSignature, g as BlockSqlAccessProvider, h as BlockSql, i as BlockSqlAudit, l as BlockSqlNames, m as moduleIdType, n as AuditCategory, o as BlockSqlContractFunction, p as isBlockSqlIdType, r as BlockSqlAction, s as BlockSqlEmit, t as AUDIT_CATEGORIES, u as BlockSqlTableSpec, v as BlockSqlEntitlementsProvider, w as blockSqlVersion, x as BlockSqlTestFile, y as BlockSqlFile } from "../context-
|
|
3
|
-
import { a as appTableEventTypes } from "../app-tables-
|
|
4
|
-
import { $ as BlockSqlPermissionKey, A as tenantsQuery, B as AdoptedView, C as declaredUpdatedAtTriggers, Ct as moduleBody, D as rlsTables, E as policyGrants, F as SECRET_COLUMNS, G as APP_TABLES_MARKER, H as adoptedTables, I as dataExportPlan, J as DEFAULT_ROLES, K as APP_TABLES_MODULE, L as excludedColumns, M as sameTenantColumn, N as sameTenantTrigger, O as subjectColumns, P as DataExportPlan, Q as BlockSqlExtension, R as resolveExposeColumns, S as declaredTables, St as customContracts, T as extensionSchema, Tt as renderBlocks, U as adoptedViews, V as adoptedColumnProblems, W as moduleWritesText, X as SQL_MODULES, Y as instanceFunctions, Z as resolveBlocks, _ as templateFunctions, _t as BlockSqlUpgradePlan, a as scopePolicyName, at as isModuleDataFile, b as declaredColumnTypes, bt as upgradePlan, c as compileReadSet, ct as moduleDataDir, d as MigrationOptionUse, dt as EntityRenameStep, et as moduleEventTriggers, f as migrationOptionUses, ft as entityRenamePlan, g as scopeProblems, gt as renamedBlock, h as resolveProviderSql, ht as formerBlockName, i as TENANT_SCOPE_POLICY, it as blockFileState, j as expiredFlagsQuery, k as TenantQuery, l as compileReadSets, lt as moduleFilePaths, m as SCOPE_ID_TYPES, mt as currentBlockName, n as declaredPolicies, nt as modulePermissionKeys, o as hasColumnAccess, ot as moduleFileVersion, p as moduleLayout, pt as BLOCK_RENAMES, q as appTablesFiles, r as widenedCommands, rt as moduleSchemaExtensions, s as CompiledReadSet, st as sameBlockFile, t as appTablePolicyNotes, tt as moduleHidingColumns, u as sharedRolesProblems, ut as EntityRenamePlan, v as DeclaredView, vt as InstalledBlock, w as declaredViews, wt as moduleTopics, x as declaredTableColumns, xt as BlockSqlTopic, y as PolicyGrant, yt as moduleDeprecations, z as AdoptedTable } from "../index-
|
|
2
|
+
import { C as OwnView, Qn as auditRegistrations, S as BlockSqlUpgrade, T as notNullCheckName, Xn as sameTenantLayout, Yn as DeclaredForeignKey, Zn as AuditedTable, _ as BlockSqlDeprecation, a as BlockSqlContext, b as BlockSqlLayout, c as BlockSqlIdType, d as MODULE_ID_TYPES, f as contractSignature, g as BlockSqlAccessProvider, h as BlockSql, i as BlockSqlAudit, l as BlockSqlNames, m as moduleIdType, n as AuditCategory, o as BlockSqlContractFunction, p as isBlockSqlIdType, r as BlockSqlAction, s as BlockSqlEmit, t as AUDIT_CATEGORIES, u as BlockSqlTableSpec, v as BlockSqlEntitlementsProvider, w as blockSqlVersion, x as BlockSqlTestFile, y as BlockSqlFile } from "../context-Cj-9gE6l.js";
|
|
3
|
+
import { a as appTableEventTypes } from "../app-tables-atP-tZKZ.js";
|
|
4
|
+
import { $ as BlockSqlPermissionKey, A as tenantsQuery, B as AdoptedView, C as declaredUpdatedAtTriggers, Ct as moduleBody, D as rlsTables, E as policyGrants, F as SECRET_COLUMNS, G as APP_TABLES_MARKER, H as adoptedTables, I as dataExportPlan, J as DEFAULT_ROLES, K as APP_TABLES_MODULE, L as excludedColumns, M as sameTenantColumn, N as sameTenantTrigger, O as subjectColumns, P as DataExportPlan, Q as BlockSqlExtension, R as resolveExposeColumns, S as declaredTables, St as customContracts, T as extensionSchema, Tt as renderBlocks, U as adoptedViews, V as adoptedColumnProblems, W as moduleWritesText, X as SQL_MODULES, Y as instanceFunctions, Z as resolveBlocks, _ as templateFunctions, _t as BlockSqlUpgradePlan, a as scopePolicyName, at as isModuleDataFile, b as declaredColumnTypes, bt as upgradePlan, c as compileReadSet, ct as moduleDataDir, d as MigrationOptionUse, dt as EntityRenameStep, et as moduleEventTriggers, f as migrationOptionUses, ft as entityRenamePlan, g as scopeProblems, gt as renamedBlock, h as resolveProviderSql, ht as formerBlockName, i as TENANT_SCOPE_POLICY, it as blockFileState, j as expiredFlagsQuery, k as TenantQuery, l as compileReadSets, lt as moduleFilePaths, m as SCOPE_ID_TYPES, mt as currentBlockName, n as declaredPolicies, nt as modulePermissionKeys, o as hasColumnAccess, ot as moduleFileVersion, p as moduleLayout, pt as BLOCK_RENAMES, q as appTablesFiles, r as widenedCommands, rt as moduleSchemaExtensions, s as CompiledReadSet, st as sameBlockFile, t as appTablePolicyNotes, tt as moduleHidingColumns, u as sharedRolesProblems, ut as EntityRenamePlan, v as DeclaredView, vt as InstalledBlock, w as declaredViews, wt as moduleTopics, x as declaredTableColumns, xt as BlockSqlTopic, y as PolicyGrant, yt as moduleDeprecations, z as AdoptedTable } from "../index-DZylLz7h.js";
|
|
5
5
|
export { APP_TABLES_MARKER, APP_TABLES_MODULE, AUDIT_CATEGORIES, type AdoptedTable, type AdoptedView, type AuditCategory, type AuditedTable, BLOCK_OPTION_SCHEMAS, BLOCK_RENAMES, type BlockOptionsRegistry, type BlockSql, type BlockSqlAccessProvider, type BlockSqlAction, type BlockSqlAudit, type BlockSqlContext, type BlockSqlContractFunction, type BlockSqlDeprecation, type BlockSqlEmit, type BlockSqlEntitlementsProvider, type BlockSqlExtension, type BlockSqlFile, type BlockSqlIdType, type BlockSqlLayout, type BlockSqlNames, type BlockSqlPermissionKey, type BlockSqlTableSpec, type BlockSqlTestFile, type BlockSqlTopic, type BlockSqlUpgrade, type BlockSqlUpgradePlan, type CompiledReadSet, DEFAULT_ROLES, type DataExportPlan, type DeclaredForeignKey, type DeclaredView, type EntityRenamePlan, type EntityRenameStep, type InstalledBlock, MODULE_ID_TYPES, type MigrationOptionUse, type OwnView, type PolicyGrant, SCOPE_ID_TYPES, SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_POLICY, type TenantQuery, adoptedColumnProblems, adoptedTables, adoptedViews, appTableEventTypes, appTablePolicyNotes, appTablesFiles, auditRegistrations, blockFileState, blockSqlVersion, compileReadSet, compileReadSets, contractSignature, currentBlockName, customContracts, dataExportPlan, declaredColumnTypes, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, entityRenamePlan, excludedColumns, expiredFlagsQuery, extensionSchema, formerBlockName, hasColumnAccess, instanceFunctions, isBlockSqlIdType, isModuleDataFile, migrationOptionUses, moduleBody, moduleDataDir, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleHidingColumns, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleWritesText, notNullCheckName, policyGrants, renamedBlock, renderBlocks, resolveBlock, resolveBlocks, resolveExposeColumns, resolveProviderSql, rlsTables, sameBlockFile, sameTenantColumn, sameTenantLayout, sameTenantTrigger, scopePolicyName, scopeProblems, sharedRolesProblems, subjectColumns, templateFunctions, tenantsQuery, upgradePlan, widenedCommands };
|
package/dist/sql/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as resolveBlock, l as appTableEventTypes, v as hasColumnAccess } from "../app-tables-DyswUg6J.js";
|
|
2
2
|
import { c as templateFunctions, o as resolveProviderSql, s as scopeProblems, t as SCOPE_ID_TYPES } from "../access-sql-CNIgUqWf.js";
|
|
3
3
|
import { Y as notNullCheckName, a as DEFAULT_ROLES } from "../workflow-sdk-DELaQEp3.js";
|
|
4
|
-
import { $ as AUDIT_CATEGORIES, A as blockFileState, B as TENANT_SCOPE_POLICY, C as moduleDataDir, D as appTablesFiles, E as APP_TABLES_MODULE, F as moduleHidingColumns, G as subjectColumns, H as resolveExposeColumns, I as modulePermissionKeys, J as migrationOptionUses, K as sameTenantColumn, L as moduleSchemaExtensions, M as moduleFileVersion, N as sameBlockFile, O as scopePolicyName, P as moduleEventTriggers, Q as renamedBlock, R as SQL_MODULES, S as widenedCommands, T as APP_TABLES_MARKER, U as SECRET_COLUMNS, V as excludedColumns, W as dataExportPlan, X as currentBlockName, Y as BLOCK_RENAMES, Z as formerBlockName, _ as renderBlocks, a as tenantsQuery, at as declaredColumnTypes, b as appTablePolicyNotes, c as adoptedColumnProblems, ct as declaredUpdatedAtTriggers, d as moduleWritesText, dt as policyGrants, et as MODULE_ID_TYPES, f as instanceFunctions, ft as rlsTables, g as moduleTopics, h as moduleBody, i as moduleLayout, it as BLOCK_OPTION_SCHEMAS, j as isModuleDataFile, k as blockSqlVersion, l as adoptedTables, lt as declaredViews, m as customContracts, n as compileReadSets, nt as isBlockSqlIdType, o as expiredFlagsQuery, ot as declaredTableColumns, p as entityRenamePlan, pt as auditRegistrations, q as sameTenantTrigger, r as sharedRolesProblems, rt as moduleIdType, s as sameTenantLayout, st as declaredTables, t as compileReadSet, tt as contractSignature, u as adoptedViews, ut as extensionSchema, v as moduleDeprecations, w as moduleFilePaths, x as declaredPolicies, y as upgradePlan, z as resolveBlocks } from "../sql-
|
|
4
|
+
import { $ as AUDIT_CATEGORIES, A as blockFileState, B as TENANT_SCOPE_POLICY, C as moduleDataDir, D as appTablesFiles, E as APP_TABLES_MODULE, F as moduleHidingColumns, G as subjectColumns, H as resolveExposeColumns, I as modulePermissionKeys, J as migrationOptionUses, K as sameTenantColumn, L as moduleSchemaExtensions, M as moduleFileVersion, N as sameBlockFile, O as scopePolicyName, P as moduleEventTriggers, Q as renamedBlock, R as SQL_MODULES, S as widenedCommands, T as APP_TABLES_MARKER, U as SECRET_COLUMNS, V as excludedColumns, W as dataExportPlan, X as currentBlockName, Y as BLOCK_RENAMES, Z as formerBlockName, _ as renderBlocks, a as tenantsQuery, at as declaredColumnTypes, b as appTablePolicyNotes, c as adoptedColumnProblems, ct as declaredUpdatedAtTriggers, d as moduleWritesText, dt as policyGrants, et as MODULE_ID_TYPES, f as instanceFunctions, ft as rlsTables, g as moduleTopics, h as moduleBody, i as moduleLayout, it as BLOCK_OPTION_SCHEMAS, j as isModuleDataFile, k as blockSqlVersion, l as adoptedTables, lt as declaredViews, m as customContracts, n as compileReadSets, nt as isBlockSqlIdType, o as expiredFlagsQuery, ot as declaredTableColumns, p as entityRenamePlan, pt as auditRegistrations, q as sameTenantTrigger, r as sharedRolesProblems, rt as moduleIdType, s as sameTenantLayout, st as declaredTables, t as compileReadSet, tt as contractSignature, u as adoptedViews, ut as extensionSchema, v as moduleDeprecations, w as moduleFilePaths, x as declaredPolicies, y as upgradePlan, z as resolveBlocks } from "../sql-D2Sc6BTr.js";
|
|
5
5
|
export { APP_TABLES_MARKER, APP_TABLES_MODULE, AUDIT_CATEGORIES, BLOCK_OPTION_SCHEMAS, BLOCK_RENAMES, DEFAULT_ROLES, MODULE_ID_TYPES, SCOPE_ID_TYPES, SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_POLICY, adoptedColumnProblems, adoptedTables, adoptedViews, appTableEventTypes, appTablePolicyNotes, appTablesFiles, auditRegistrations, blockFileState, blockSqlVersion, compileReadSet, compileReadSets, contractSignature, currentBlockName, customContracts, dataExportPlan, declaredColumnTypes, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, entityRenamePlan, excludedColumns, expiredFlagsQuery, extensionSchema, formerBlockName, hasColumnAccess, instanceFunctions, isBlockSqlIdType, isModuleDataFile, migrationOptionUses, moduleBody, moduleDataDir, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleHidingColumns, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleWritesText, notNullCheckName, policyGrants, renamedBlock, renderBlocks, resolveBlock, resolveBlocks, resolveExposeColumns, resolveProviderSql, rlsTables, sameBlockFile, sameTenantColumn, sameTenantLayout, sameTenantTrigger, scopePolicyName, scopeProblems, sharedRolesProblems, subjectColumns, templateFunctions, tenantsQuery, upgradePlan, widenedCommands };
|
|
@@ -505,19 +505,44 @@ $$;
|
|
|
505
505
|
revoke execute on function better_supabase.as_column_type(text, anyelement) from public;
|
|
506
506
|
grant execute on function better_supabase.as_column_type(text, anyelement) to anon, authenticated, service_role;`;
|
|
507
507
|
}
|
|
508
|
+
function tryColumnTypeFunction() {
|
|
509
|
+
return `${SCHEMA$5}
|
|
510
|
+
create or replace function better_supabase.try_column_type(value text, target anyelement)
|
|
511
|
+
returns anyelement
|
|
512
|
+
language plpgsql
|
|
513
|
+
stable
|
|
514
|
+
security invoker
|
|
515
|
+
set search_path = ''
|
|
516
|
+
as $$
|
|
517
|
+
declare
|
|
518
|
+
result alias for $0;
|
|
519
|
+
begin
|
|
520
|
+
result := value;
|
|
521
|
+
return result;
|
|
522
|
+
exception when data_exception or check_violation then
|
|
523
|
+
return null;
|
|
524
|
+
end;
|
|
525
|
+
$$;
|
|
526
|
+
revoke execute on function better_supabase.try_column_type(text, anyelement) from public;
|
|
527
|
+
grant execute on function better_supabase.try_column_type(text, anyelement) to anon, authenticated, service_role;`;
|
|
528
|
+
}
|
|
508
529
|
/** `value` (text) cast to the type of `column` on the quoted `table`. */
|
|
509
530
|
function asColumnType(table, column, value) {
|
|
510
531
|
return `better_supabase.as_column_type(${value}, (null::${table}).${sqlIdent(column)})`;
|
|
511
532
|
}
|
|
533
|
+
function tryColumnType(table, column, value) {
|
|
534
|
+
return `better_supabase.try_column_type(${value}, (null::${table}).${sqlIdent(column)})`;
|
|
535
|
+
}
|
|
536
|
+
const FUNCTIONS$1 = [["as_column_type", columnTypeFunction], ["try_column_type", tryColumnTypeFunction]];
|
|
512
537
|
/**
|
|
513
|
-
* `sql` with `better_supabase.as_column_type`
|
|
514
|
-
*
|
|
515
|
-
* type's input function, so a text value becomes an enum
|
|
516
|
-
* type `target` has.
|
|
538
|
+
* `sql` with `better_supabase.as_column_type` and `try_column_type` defined
|
|
539
|
+
* ahead of it when it calls them and does not define them. PL/pgSQL returns
|
|
540
|
+
* `value` through the type's input function, so a text value becomes an enum
|
|
541
|
+
* label or any other type `target` has.
|
|
517
542
|
*/
|
|
518
543
|
function withColumnTypeFunction(sql) {
|
|
519
|
-
|
|
520
|
-
return `${
|
|
544
|
+
const missing = FUNCTIONS$1.filter(([name]) => sql.includes(`better_supabase.${name}(`) && !sql.includes(`function better_supabase.${name}(`));
|
|
545
|
+
return missing.length === 0 ? sql : `${missing.map(([, define]) => define()).join("\n")}\n${sql}`;
|
|
521
546
|
}
|
|
522
547
|
//#endregion
|
|
523
548
|
//#region src/sql/audit-registrations.ts
|
|
@@ -1312,11 +1337,11 @@ function tableOwnership(input, column, requiredColumn) {
|
|
|
1312
1337
|
name: `${UNMAPPED_TABLE}${logical}`
|
|
1313
1338
|
} : input.tableName(logical),
|
|
1314
1339
|
col: (table, logical) => sqlIdent(column(table, logical) === null && appOwned.includes(table) ? `${UNMAPPED_COLUMN}${table}.${logical}` : requiredColumn(table, logical)),
|
|
1315
|
-
cast: (table, logical, value) => {
|
|
1340
|
+
cast: (table, logical, value, invalid = "raise") => {
|
|
1316
1341
|
if (input.tables[table]?.typed?.includes(logical) !== true) throw new TypeError(`Module "${input.module}" casts ${table}.${logical}, which its names.tables.${table}.typed doesn't list`);
|
|
1317
1342
|
if (!appOwned.includes(table)) return value;
|
|
1318
1343
|
const parts = input.tableName(table);
|
|
1319
|
-
return asColumnType(`${sqlIdent(parts.schema)}.${sqlIdent(parts.name)}`, requiredColumn(table, logical), value);
|
|
1344
|
+
return (invalid === "null" ? tryColumnType : asColumnType)(`${sqlIdent(parts.schema)}.${sqlIdent(parts.name)}`, requiredColumn(table, logical), value);
|
|
1320
1345
|
}
|
|
1321
1346
|
};
|
|
1322
1347
|
}
|
|
@@ -81029,7 +81054,8 @@ const NAMES$45 = {
|
|
|
81029
81054
|
"createdAt",
|
|
81030
81055
|
"updatedAt"
|
|
81031
81056
|
],
|
|
81032
|
-
yieldsToExtra: ["locale"]
|
|
81057
|
+
yieldsToExtra: ["locale"],
|
|
81058
|
+
typed: ["locale"]
|
|
81033
81059
|
} },
|
|
81034
81060
|
hooks: [
|
|
81035
81061
|
"after_profile_sync",
|
|
@@ -81130,6 +81156,8 @@ function syncValues(ctx) {
|
|
|
81130
81156
|
if (has("lastName")) values.set(col("lastName"), `coalesce(${values.get(col("lastName")) ?? "null"}, nullif(btrim(substr(${full}, length(split_part(${full}, ' ', 1)) + 1)), ''))`);
|
|
81131
81157
|
}
|
|
81132
81158
|
}
|
|
81159
|
+
const fromLocale = hasLocale(ctx) ? values.get(col("locale")) : void 0;
|
|
81160
|
+
if (fromLocale !== void 0) values.set(col("locale"), ctx.cast("profiles", "locale", fromLocale, "null"));
|
|
81133
81161
|
if (has("email")) values.set(col("email"), "lower(u.email)");
|
|
81134
81162
|
if (has("username") && ctx.flag("username", true)) values.set(col("username"), `${ctx.fn("allocate_username")}(coalesce(${usernameSource(ctx, values)}, split_part(u.email, '@', 1)), user_id)`);
|
|
81135
81163
|
return values;
|
|
@@ -81615,7 +81643,8 @@ function selfUpdates(ctx) {
|
|
|
81615
81643
|
return [...columns.map((logical) => {
|
|
81616
81644
|
const quoted = ctx.col("profiles", logical);
|
|
81617
81645
|
const key = sqlString(profilePhysical(ctx, logical));
|
|
81618
|
-
|
|
81646
|
+
const value = `update_my_profile.attrs ${logical === "onboarding" ? "->" : "->>"} ${key}`;
|
|
81647
|
+
return `${quoted} = case when update_my_profile.attrs ? ${key} then ${logical === "locale" ? ctx.cast("profiles", logical, value) : value} else p.${quoted} end`;
|
|
81619
81648
|
}), ...extras].join(",\n ");
|
|
81620
81649
|
}
|
|
81621
81650
|
/**
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceM
|
|
|
6
6
|
import { t as AuthSnapshot } from "../bind-pu5TLrla.js";
|
|
7
7
|
import { t as AuthSession } from "../view-DyFdMCqg.js";
|
|
8
8
|
import { n as Controller } from "../controller-BR7CZ1R9.js";
|
|
9
|
-
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-
|
|
9
|
+
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DkAemDoc.js";
|
|
10
10
|
import { n as BlockOptions } from "../block-env-CA65ulTD.js";
|
|
11
11
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
|
|
12
12
|
import { SupabaseClient } from "@supabase/supabase-js";
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { r as GuardOptions } from "../respond-oZeJ342J.js";
|
|
|
26
26
|
import { l as Transcriber, s as NoteTaker, u as TranscriberInput } from "../recordings-BBSJt_YV.js";
|
|
27
27
|
import { n as Controller } from "../controller-BR7CZ1R9.js";
|
|
28
28
|
import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-DzLh6BYI.js";
|
|
29
|
-
import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-
|
|
29
|
+
import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-Cj-9gE6l.js";
|
|
30
30
|
import { r as WebhookInput } from "../signatures-Dkx9OE8j.js";
|
|
31
31
|
import { n as Payment, o as PaymentProvider } from "../payments-BYcN34Fp.js";
|
|
32
32
|
import { t as NotificationChannel } from "../channel-JcMd5lNP.js";
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceM
|
|
|
6
6
|
import { t as AuthSnapshot } from "../bind-pu5TLrla.js";
|
|
7
7
|
import { t as AuthSession } from "../view-DyFdMCqg.js";
|
|
8
8
|
import { n as Controller } from "../controller-BR7CZ1R9.js";
|
|
9
|
-
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-
|
|
9
|
+
import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DkAemDoc.js";
|
|
10
10
|
import { n as BlockOptions } from "../block-env-CA65ulTD.js";
|
|
11
11
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
|
|
12
12
|
import { t as SupportView } from "../support-view-BYOgwXsJ.js";
|
package/package.json
CHANGED
package/dist/cli/add-BQPJnapO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as addCommand } from "./add-B1S3yK4L.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as powersyncStreamsCommand } from "./powersync-D-0yV_L_.js";
|