@pol-studios/db 1.0.49 → 1.0.51

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDbUpsert
3
- } from "./chunk-RJIVXO4U.js";
3
+ } from "./chunk-3Q74DK5K.js";
4
4
  import {
5
5
  normalizeFilter
6
6
  } from "./chunk-Z3EJX3VG.js";
@@ -9,10 +9,10 @@ import {
9
9
  } from "./chunk-7SCJNYTE.js";
10
10
  import {
11
11
  useDbQuery
12
- } from "./chunk-DKUF2FKB.js";
12
+ } from "./chunk-DP3YEVSX.js";
13
13
  import {
14
14
  useDataLayerCoreOptional
15
- } from "./chunk-AIYPSXIO.js";
15
+ } from "./chunk-WQLIGVQR.js";
16
16
  import {
17
17
  getSupabaseUrl
18
18
  } from "./chunk-GC3TBUWE.js";
@@ -4703,6 +4703,7 @@ var AdapterRegistry = class {
4703
4703
  } else {
4704
4704
  this.syncTrackingAdapter = null;
4705
4705
  }
4706
+ this.adapters.clear();
4706
4707
  }
4707
4708
  /**
4708
4709
  * Set a getter function for lazy PowerSync adapter initialization.
@@ -4824,16 +4825,22 @@ var AdapterRegistry = class {
4824
4825
  const isConfigured = powerSyncTableKeys.some((key) => key === table || key === tableWithoutSchema || key.includes(".") && key.split(".")[1] === tableWithoutSchema);
4825
4826
  if (!isConfigured) {
4826
4827
  if (this.supabaseAdapter) {
4828
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
4829
+ console.warn(`[AdapterRegistry] Table "${table}" is not configured for PowerSync sync. Using Supabase fallback.`);
4830
+ }
4827
4831
  return this.supabaseAdapter;
4828
4832
  }
4829
4833
  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.`);
4830
4834
  }
4831
4835
  }
4832
- return this.getAutoAdapter(strategy);
4836
+ return this.getAutoAdapter(strategy, table);
4833
4837
  }
4834
4838
  if (strategy.strategy === "powersync" && this.autoDetector && this.supabaseAdapter) {
4835
4839
  const detection = this.autoDetector.detectSilent();
4836
4840
  if (detection.powerSyncStatus === "initializing" /* INITIALIZING */ && detection.isOnline) {
4841
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
4842
+ console.warn(`[AdapterRegistry] Table "${table}" configured for PowerSync but using Supabase. PowerSync status: ${detection.powerSyncStatus}, Online: ${detection.isOnline}`);
4843
+ }
4837
4844
  return this.supabaseAdapter;
4838
4845
  }
4839
4846
  }
@@ -4935,11 +4942,14 @@ var AdapterRegistry = class {
4935
4942
  * @param strategy - Optional auto strategy configuration
4936
4943
  * @returns The automatically selected adapter
4937
4944
  */
4938
- getAutoAdapter(_strategy) {
4945
+ getAutoAdapter(_strategy, table) {
4939
4946
  if (!this.autoDetector) {
4940
4947
  if (!this.supabaseAdapter) {
4941
4948
  throw new Error("No auto-detector configured and Supabase adapter not available. Either initialize auto-detection or set adapters explicitly.");
4942
4949
  }
4950
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
4951
+ console.warn(`[AdapterRegistry] No auto-detector configured${table ? ` for table "${table}"` : ""}. Using Supabase fallback.`);
4952
+ }
4943
4953
  return this.supabaseAdapter;
4944
4954
  }
4945
4955
  const detection = this.autoDetector.detectSilent();
@@ -4949,6 +4959,9 @@ var AdapterRegistry = class {
4949
4959
  if (!this.supabaseAdapter) {
4950
4960
  throw new Error("Neither PowerSync nor Supabase adapters are available.");
4951
4961
  }
4962
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
4963
+ console.warn(`[AdapterRegistry] PowerSync recommended${table ? ` for table "${table}"` : ""} but adapter not available. Falling back to Supabase. Reason: ${detection.reason}`);
4964
+ }
4952
4965
  return this.supabaseAdapter;
4953
4966
  }
4954
4967
  return this.powerSyncAdapter;
@@ -5039,6 +5052,9 @@ var AdapterRegistry = class {
5039
5052
  if (!this.supabaseAdapter) {
5040
5053
  throw new Error("Supabase adapter not initialized. Ensure SupabaseAdapter is set before accessing tables.");
5041
5054
  }
5055
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
5056
+ console.warn(`[AdapterRegistry] Unknown strategy "${strategy.strategy}". Using Supabase fallback.`);
5057
+ }
5042
5058
  return this.supabaseAdapter;
5043
5059
  }
5044
5060
  }
@@ -5059,6 +5075,8 @@ var AdapterRegistry = class {
5059
5075
  reset() {
5060
5076
  this.adapters.clear();
5061
5077
  this.powerSyncAdapter = null;
5078
+ this.powerSyncGetter = null;
5079
+ this.powerSyncAdapterFactory = null;
5062
5080
  this.supabaseAdapter = null;
5063
5081
  this.cachedAdapter = null;
5064
5082
  this.deps = null;
@@ -7987,4 +8005,4 @@ moment/moment.js:
7987
8005
  (*! license : MIT *)
7988
8006
  (*! momentjs.com *)
7989
8007
  */
7990
- //# sourceMappingURL=chunk-V4MNSMMA.js.map
8008
+ //# sourceMappingURL=chunk-PGTRDT5K.js.map