@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.
@@ -6,7 +6,7 @@ import {
6
6
  useDataLayerCore,
7
7
  useDataLayerStatus,
8
8
  useDbQuery
9
- } from "./chunk-5SJ5O2NQ.js";
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-D2F3APBF.js.map
1246
+ //# sourceMappingURL=chunk-ROLZ635F.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  permissionContext,
3
3
  setupAuthContext
4
- } from "./chunk-MZLEDWJF.js";
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-D7UZEYKO.js.map
208
+ //# sourceMappingURL=chunk-V54K6CMB.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDbUpsert
3
- } from "./chunk-D2F3APBF.js";
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-MZLEDWJF.js";
12
+ } from "./chunk-CNKNEYRB.js";
13
13
  import {
14
14
  useDataLayerCoreOptional
15
- } from "./chunk-5SJ5O2NQ.js";
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-AQ5JJKIN.js.map
7940
+ //# sourceMappingURL=chunk-VOC2RRFE.js.map