@pol-studios/db 1.0.44 → 1.0.46
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/auth/context.js +2 -2
- package/dist/auth/hooks.js +3 -3
- package/dist/auth/index.js +3 -3
- package/dist/{chunk-5SJ5O2NQ.js → chunk-6TZOUA3G.js} +25 -7
- package/dist/{chunk-5SJ5O2NQ.js.map → chunk-6TZOUA3G.js.map} +1 -1
- package/dist/{chunk-3UW5K5PL.js → chunk-ADYMMIIJ.js} +3 -3
- package/dist/{chunk-MZLEDWJF.js → chunk-CNKNEYRB.js} +15 -3
- package/dist/chunk-CNKNEYRB.js.map +1 -0
- package/dist/{chunk-Z6ZHXO2R.js → chunk-FFHMWRRW.js} +4 -4
- package/dist/{chunk-D2F3APBF.js → chunk-ROLZ635F.js} +2 -2
- package/dist/{chunk-D7UZEYKO.js → chunk-V54K6CMB.js} +2 -2
- package/dist/{chunk-AQ5JJKIN.js → chunk-VOC2RRFE.js} +17 -4
- package/dist/chunk-VOC2RRFE.js.map +1 -0
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +7 -7
- package/dist/index.native.js +7 -7
- package/dist/index.web.js +6 -6
- package/dist/with-auth/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-AQ5JJKIN.js.map +0 -1
- package/dist/chunk-MZLEDWJF.js.map +0 -1
- /package/dist/{chunk-3UW5K5PL.js.map → chunk-ADYMMIIJ.js.map} +0 -0
- /package/dist/{chunk-Z6ZHXO2R.js.map → chunk-FFHMWRRW.js.map} +0 -0
- /package/dist/{chunk-D2F3APBF.js.map → chunk-ROLZ635F.js.map} +0 -0
- /package/dist/{chunk-D7UZEYKO.js.map → chunk-V54K6CMB.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useDataLayerCore,
|
|
7
7
|
useDataLayerStatus,
|
|
8
8
|
useDbQuery
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6TZOUA3G.js";
|
|
10
10
|
import {
|
|
11
11
|
getSupabaseUrl
|
|
12
12
|
} from "./chunk-GC3TBUWE.js";
|
|
@@ -1243,4 +1243,4 @@ export {
|
|
|
1243
1243
|
useSyncControl,
|
|
1244
1244
|
useOnlineStatus
|
|
1245
1245
|
};
|
|
1246
|
-
//# sourceMappingURL=chunk-
|
|
1246
|
+
//# sourceMappingURL=chunk-ROLZ635F.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
permissionContext,
|
|
3
3
|
setupAuthContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CNKNEYRB.js";
|
|
5
5
|
|
|
6
6
|
// src/auth/hooks/useAuth.ts
|
|
7
7
|
import { isUsable } from "@pol-studios/utils";
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
useInvalidatePermission,
|
|
206
206
|
usePermissionLoading
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=chunk-
|
|
208
|
+
//# sourceMappingURL=chunk-V54K6CMB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDbUpsert
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ROLZ635F.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeFilter
|
|
6
6
|
} from "./chunk-Z456IHCB.js";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-7SCJNYTE.js";
|
|
10
10
|
import {
|
|
11
11
|
useDbQuery
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CNKNEYRB.js";
|
|
13
13
|
import {
|
|
14
14
|
useDataLayerCoreOptional
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6TZOUA3G.js";
|
|
16
16
|
import {
|
|
17
17
|
getSupabaseUrl
|
|
18
18
|
} from "./chunk-GC3TBUWE.js";
|
|
@@ -4755,12 +4755,19 @@ var AdapterRegistry = class {
|
|
|
4755
4755
|
getAdapter(table, operation = "read") {
|
|
4756
4756
|
const tableWithoutSchema = table.includes(".") ? table.split(".")[1] : table;
|
|
4757
4757
|
const strategy = this.config.tables[table] ?? this.config.tables[tableWithoutSchema];
|
|
4758
|
+
if (table.includes("Profile") || table.includes("UserAccess")) {
|
|
4759
|
+
console.log(`[AdapterRegistry.getAdapter] table=${table}, strategy=${strategy?.strategy ?? "undefined"}, operation=${operation}`);
|
|
4760
|
+
}
|
|
4758
4761
|
if (!strategy || strategy.strategy === "auto") {
|
|
4759
4762
|
if (this.powerSyncAdapter) {
|
|
4760
4763
|
const powerSyncTableKeys = this.getPowerSyncTableKeys();
|
|
4761
4764
|
const isConfigured = powerSyncTableKeys.some((key) => key === table || key === tableWithoutSchema || key.includes(".") && key.split(".")[1] === tableWithoutSchema);
|
|
4765
|
+
if (table.includes("Profile") || table.includes("UserAccess")) {
|
|
4766
|
+
console.log(`[AdapterRegistry.getAdapter] auto strategy check: isConfigured=${isConfigured}, hasPowerSync=${!!this.powerSyncAdapter}, hasSupabase=${!!this.supabaseAdapter}`);
|
|
4767
|
+
}
|
|
4762
4768
|
if (!isConfigured) {
|
|
4763
4769
|
if (this.supabaseAdapter) {
|
|
4770
|
+
console.log(`[AdapterRegistry.getAdapter] Returning Supabase adapter for ${table} (not in PowerSync schema)`);
|
|
4764
4771
|
return this.supabaseAdapter;
|
|
4765
4772
|
}
|
|
4766
4773
|
throw new Error(`Table "${table}" is not configured for PowerSync sync and Supabase adapter is not available. Either add this table to the PowerSync schema or initialize the Supabase adapter.`);
|
|
@@ -5157,10 +5164,16 @@ var SupabaseAdapter = class {
|
|
|
5157
5164
|
schema,
|
|
5158
5165
|
tableName
|
|
5159
5166
|
} = this.parseTableIdentifier(table);
|
|
5167
|
+
console.log(`[SupabaseAdapter.queryById] Querying ${schema}.${tableName} where id=${id}`);
|
|
5160
5168
|
const {
|
|
5161
5169
|
data,
|
|
5162
5170
|
error
|
|
5163
5171
|
} = await this.supabase.schema(schema).from(tableName).select(select).eq("id", id).single();
|
|
5172
|
+
console.log(`[SupabaseAdapter.queryById] Result:`, {
|
|
5173
|
+
data: !!data,
|
|
5174
|
+
error: error?.message,
|
|
5175
|
+
errorCode: error?.code
|
|
5176
|
+
});
|
|
5164
5177
|
if (error) {
|
|
5165
5178
|
if (error.code === "PGRST116") {
|
|
5166
5179
|
return null;
|
|
@@ -7924,4 +7937,4 @@ moment/moment.js:
|
|
|
7924
7937
|
(*! license : MIT *)
|
|
7925
7938
|
(*! momentjs.com *)
|
|
7926
7939
|
*/
|
|
7927
|
-
//# sourceMappingURL=chunk-
|
|
7940
|
+
//# sourceMappingURL=chunk-VOC2RRFE.js.map
|