@pol-studios/db 1.0.45 → 1.0.47

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.
Files changed (34) hide show
  1. package/dist/{DataLayerContext-BwMk4VpG.d.ts → DataLayerContext-DWlohoEg.d.ts} +2 -2
  2. package/dist/auth/context.js +2 -2
  3. package/dist/auth/hooks.js +3 -3
  4. package/dist/auth/index.js +3 -3
  5. package/dist/{chunk-CIF7HW2V.js → chunk-5KZ5ZB7B.js} +16 -16
  6. package/dist/chunk-5KZ5ZB7B.js.map +1 -0
  7. package/dist/{chunk-5MFB5PA2.js → chunk-5TWB3SMJ.js} +3 -15
  8. package/dist/chunk-5TWB3SMJ.js.map +1 -0
  9. package/dist/{chunk-AVFS723B.js → chunk-AIYPSXIO.js} +6 -9
  10. package/dist/{chunk-AVFS723B.js.map → chunk-AIYPSXIO.js.map} +1 -1
  11. package/dist/{chunk-DCZX7MZE.js → chunk-HJXJIBXC.js} +3 -3
  12. package/dist/{chunk-CSAD5PX5.js → chunk-POU4MVXN.js} +4 -4
  13. package/dist/{chunk-K2LSHTZC.js → chunk-RJIVXO4U.js} +2 -2
  14. package/dist/{chunk-RUGTKP45.js → chunk-UCXYYGFG.js} +2 -2
  15. package/dist/hooks/index.d.ts +2 -2
  16. package/dist/hooks/index.js +2 -2
  17. package/dist/{index-lveh8qb0.d.ts → index-CvAHE2Y2.d.ts} +1 -1
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.js +7 -7
  20. package/dist/index.native.d.ts +5 -5
  21. package/dist/index.native.js +7 -7
  22. package/dist/index.web.d.ts +6 -6
  23. package/dist/index.web.js +6 -6
  24. package/dist/types/index.d.ts +2 -2
  25. package/dist/{useDbCount-DWfYB2iu.d.ts → useDbCount-Chl9uuR1.d.ts} +1 -1
  26. package/dist/{useResolveFeedback-CxLccZKK.d.ts → useResolveFeedback-lNxMVfUw.d.ts} +3 -3
  27. package/dist/with-auth/index.js +5 -5
  28. package/package.json +1 -1
  29. package/dist/chunk-5MFB5PA2.js.map +0 -1
  30. package/dist/chunk-CIF7HW2V.js.map +0 -1
  31. /package/dist/{chunk-DCZX7MZE.js.map → chunk-HJXJIBXC.js.map} +0 -0
  32. /package/dist/{chunk-CSAD5PX5.js.map → chunk-POU4MVXN.js.map} +0 -0
  33. /package/dist/{chunk-K2LSHTZC.js.map → chunk-RJIVXO4U.js.map} +0 -0
  34. /package/dist/{chunk-RUGTKP45.js.map → chunk-UCXYYGFG.js.map} +0 -0
@@ -679,13 +679,13 @@ declare class AdapterRegistry {
679
679
  * Check if a table uses PowerSync strategy
680
680
  *
681
681
  * @param table - The table name (may include schema prefix like "core.Profile")
682
- * @returns True if table uses PowerSync or Hybrid strategy
682
+ * @returns True if table uses PowerSync, Hybrid, or Auto strategy
683
683
  */
684
684
  usesPowerSync(table: string): boolean;
685
685
  /**
686
686
  * Get all table config keys that use PowerSync (may be schema-qualified)
687
687
  *
688
- * @returns Array of config keys using PowerSync or Hybrid strategy
688
+ * @returns Array of config keys using PowerSync, Hybrid, or Auto strategy
689
689
  */
690
690
  getPowerSyncTableKeys(): string[];
691
691
  /**
@@ -11,8 +11,8 @@ import {
11
11
  useUserMetadataState,
12
12
  useUserMetadataValue,
13
13
  userMetadataContext
14
- } from "../chunk-5MFB5PA2.js";
15
- import "../chunk-AVFS723B.js";
14
+ } from "../chunk-5TWB3SMJ.js";
15
+ import "../chunk-AIYPSXIO.js";
16
16
  import "../chunk-J4ZVCXZ4.js";
17
17
  import "../chunk-YUX6RGLZ.js";
18
18
  import "../chunk-AKIRHA4Q.js";
@@ -11,14 +11,14 @@ import {
11
11
  usePermissionLoading,
12
12
  usePermissionsBatch,
13
13
  useSetupAuth
14
- } from "../chunk-RUGTKP45.js";
14
+ } from "../chunk-UCXYYGFG.js";
15
15
  import {
16
16
  useSetUserMetadata,
17
17
  useUserMetadata,
18
18
  useUserMetadataState,
19
19
  useUserMetadataValue
20
- } from "../chunk-5MFB5PA2.js";
21
- import "../chunk-AVFS723B.js";
20
+ } from "../chunk-5TWB3SMJ.js";
21
+ import "../chunk-AIYPSXIO.js";
22
22
  import "../chunk-J4ZVCXZ4.js";
23
23
  import "../chunk-YUX6RGLZ.js";
24
24
  import "../chunk-AKIRHA4Q.js";
@@ -12,7 +12,7 @@ import {
12
12
  usePermissionLoading,
13
13
  usePermissionsBatch,
14
14
  useSetupAuth
15
- } from "../chunk-RUGTKP45.js";
15
+ } from "../chunk-UCXYYGFG.js";
16
16
  import {
17
17
  AuthProvider,
18
18
  PermissionProvider,
@@ -26,8 +26,8 @@ import {
26
26
  useUserMetadataState,
27
27
  useUserMetadataValue,
28
28
  userMetadataContext
29
- } from "../chunk-5MFB5PA2.js";
30
- import "../chunk-AVFS723B.js";
29
+ } from "../chunk-5TWB3SMJ.js";
30
+ import "../chunk-AIYPSXIO.js";
31
31
  import {
32
32
  hasAccess,
33
33
  hasAllAccess,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDbUpsert
3
- } from "./chunk-K2LSHTZC.js";
3
+ } from "./chunk-RJIVXO4U.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-5MFB5PA2.js";
12
+ } from "./chunk-5TWB3SMJ.js";
13
13
  import {
14
14
  useDataLayerCoreOptional
15
- } from "./chunk-AVFS723B.js";
15
+ } from "./chunk-AIYPSXIO.js";
16
16
  import {
17
17
  getSupabaseUrl
18
18
  } from "./chunk-GC3TBUWE.js";
@@ -4834,19 +4834,19 @@ var AdapterRegistry = class {
4834
4834
  * Check if a table uses PowerSync strategy
4835
4835
  *
4836
4836
  * @param table - The table name (may include schema prefix like "core.Profile")
4837
- * @returns True if table uses PowerSync or Hybrid strategy
4837
+ * @returns True if table uses PowerSync, Hybrid, or Auto strategy
4838
4838
  */
4839
4839
  usesPowerSync(table) {
4840
4840
  const strategy = this.getTableStrategy(table);
4841
- return strategy?.strategy === "powersync" || strategy?.strategy === "hybrid";
4841
+ return strategy?.strategy === "powersync" || strategy?.strategy === "hybrid" || strategy?.strategy === "auto";
4842
4842
  }
4843
4843
  /**
4844
4844
  * Get all table config keys that use PowerSync (may be schema-qualified)
4845
4845
  *
4846
- * @returns Array of config keys using PowerSync or Hybrid strategy
4846
+ * @returns Array of config keys using PowerSync, Hybrid, or Auto strategy
4847
4847
  */
4848
4848
  getPowerSyncTableKeys() {
4849
- return Object.entries(this.config.tables).filter(([_, strategy]) => strategy.strategy === "powersync" || strategy.strategy === "hybrid").map(([key]) => key);
4849
+ return Object.entries(this.config.tables).filter(([_, strategy]) => strategy.strategy === "powersync" || strategy.strategy === "hybrid" || strategy.strategy === "auto").map(([key]) => key);
4850
4850
  }
4851
4851
  /**
4852
4852
  * Get all tables that use PowerSync (returns aliases for PowerSync schema)
@@ -4854,7 +4854,7 @@ var AdapterRegistry = class {
4854
4854
  * @returns Array of PowerSync table aliases
4855
4855
  */
4856
4856
  getPowerSyncTables() {
4857
- return Object.entries(this.config.tables).filter(([_, strategy]) => strategy.strategy === "powersync" || strategy.strategy === "hybrid").map(([key, strategy]) => getPowerSyncAlias(key, strategy));
4857
+ return Object.entries(this.config.tables).filter(([_, strategy]) => strategy.strategy === "powersync" || strategy.strategy === "hybrid" || strategy.strategy === "auto").map(([key, strategy]) => getPowerSyncAlias(key, strategy));
4858
4858
  }
4859
4859
  /**
4860
4860
  * Get the PowerSync alias for a table.
@@ -4957,7 +4957,13 @@ var AdapterRegistry = class {
4957
4957
  switch (strategy.strategy) {
4958
4958
  case "powersync":
4959
4959
  if (!this.powerSyncAdapter) {
4960
- throw new Error("PowerSync adapter not initialized. Ensure PowerSyncAdapter is set before accessing PowerSync tables.");
4960
+ if (this.supabaseAdapter) {
4961
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
4962
+ console.warn(`[AdapterRegistry] PowerSync not ready, falling back to Supabase`);
4963
+ }
4964
+ return this.supabaseAdapter;
4965
+ }
4966
+ throw new Error("PowerSync adapter not initialized and Supabase not available. Ensure PowerSyncAdapter is set before accessing PowerSync tables.");
4961
4967
  }
4962
4968
  return this.syncTrackingAdapter ?? this.powerSyncAdapter;
4963
4969
  case "supabase":
@@ -5157,16 +5163,10 @@ var SupabaseAdapter = class {
5157
5163
  schema,
5158
5164
  tableName
5159
5165
  } = this.parseTableIdentifier(table);
5160
- console.log(`[SupabaseAdapter.queryById] Querying ${schema}.${tableName} where id=${id}`);
5161
5166
  const {
5162
5167
  data,
5163
5168
  error
5164
5169
  } = await this.supabase.schema(schema).from(tableName).select(select).eq("id", id).single();
5165
- console.log(`[SupabaseAdapter.queryById] Result:`, {
5166
- data: !!data,
5167
- error: error?.message,
5168
- errorCode: error?.code
5169
- });
5170
5170
  if (error) {
5171
5171
  if (error.code === "PGRST116") {
5172
5172
  return null;
@@ -7930,4 +7930,4 @@ moment/moment.js:
7930
7930
  (*! license : MIT *)
7931
7931
  (*! momentjs.com *)
7932
7932
  */
7933
- //# sourceMappingURL=chunk-CIF7HW2V.js.map
7933
+ //# sourceMappingURL=chunk-5KZ5ZB7B.js.map