@pol-studios/db 1.0.52 → 1.0.53
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/{DataLayerContext-C7cJtiO8.d.ts → DataLayerContext-DND_nO5a.d.ts} +1 -1
- package/dist/{chunk-GSORUAS7.js → chunk-D55QGM4P.js} +3 -3
- package/dist/{chunk-EOJGUOJR.js → chunk-FZJX2FZS.js} +13 -5
- package/dist/chunk-FZJX2FZS.js.map +1 -0
- package/dist/{chunk-QJZUIAHA.js → chunk-HZIVE5AZ.js} +14 -6
- package/dist/{chunk-QJZUIAHA.js.map → chunk-HZIVE5AZ.js.map} +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/{index-jVYdTeWx.d.ts → index-bMBDRkMF.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/index.native.d.ts +5 -5
- package/dist/index.native.js +3 -3
- package/dist/index.web.d.ts +6 -6
- package/dist/index.web.js +2 -2
- package/dist/query/index.js +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/{useDbCount-DHLJzmkO.d.ts → useDbCount-BGSlyv-F.d.ts} +1 -1
- package/dist/{useResolveFeedback-B0UcYWVI.d.ts → useResolveFeedback-DLvQD0Wl.d.ts} +3 -3
- package/package.json +3 -3
- package/dist/chunk-EOJGUOJR.js.map +0 -1
- /package/dist/{chunk-GSORUAS7.js.map → chunk-D55QGM4P.js.map} +0 -0
|
@@ -742,7 +742,7 @@ declare class AdapterRegistry {
|
|
|
742
742
|
/**
|
|
743
743
|
* Get adapter using auto-detection.
|
|
744
744
|
*
|
|
745
|
-
* Simple logic: PowerSync first, Supabase fallback.
|
|
745
|
+
* Simple logic: PowerSync first, Supabase fallback ONLY when online.
|
|
746
746
|
* Once PowerSync is initialized, always use it for offline-first behavior.
|
|
747
747
|
*/
|
|
748
748
|
private getAutoAdapter;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createAdapterRegistry,
|
|
4
4
|
createSupabaseAdapter,
|
|
5
5
|
stripSchemaPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FZJX2FZS.js";
|
|
7
7
|
import {
|
|
8
8
|
DataLayerContext,
|
|
9
9
|
DataLayerCoreContext,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
QueryExecutor,
|
|
14
14
|
extractRelationNames,
|
|
15
15
|
parseSelect
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HZIVE5AZ.js";
|
|
17
17
|
import {
|
|
18
18
|
useSupabase
|
|
19
19
|
} from "./chunk-DMVUEJG2.js";
|
|
@@ -4968,4 +4968,4 @@ object-assign/index.js:
|
|
|
4968
4968
|
@license MIT
|
|
4969
4969
|
*)
|
|
4970
4970
|
*/
|
|
4971
|
-
//# sourceMappingURL=chunk-
|
|
4971
|
+
//# sourceMappingURL=chunk-D55QGM4P.js.map
|
|
@@ -4512,7 +4512,11 @@ var AdapterRegistry = class {
|
|
|
4512
4512
|
return this.syncTrackingAdapter ?? this.powerSyncAdapter;
|
|
4513
4513
|
}
|
|
4514
4514
|
if (this.supabaseAdapter) {
|
|
4515
|
-
|
|
4515
|
+
const isOnline = this.autoDetector?.getSyncStatus()?.isOnline ?? (typeof navigator !== "undefined" ? navigator.onLine : false);
|
|
4516
|
+
if (isOnline) {
|
|
4517
|
+
return this.supabaseAdapter;
|
|
4518
|
+
}
|
|
4519
|
+
throw new Error(`Offline and PowerSync not ready for table "${table}". Wait for initialization.`);
|
|
4516
4520
|
}
|
|
4517
4521
|
}
|
|
4518
4522
|
const existing = this.adapters.get(table);
|
|
@@ -4610,15 +4614,19 @@ var AdapterRegistry = class {
|
|
|
4610
4614
|
/**
|
|
4611
4615
|
* Get adapter using auto-detection.
|
|
4612
4616
|
*
|
|
4613
|
-
* Simple logic: PowerSync first, Supabase fallback.
|
|
4617
|
+
* Simple logic: PowerSync first, Supabase fallback ONLY when online.
|
|
4614
4618
|
* Once PowerSync is initialized, always use it for offline-first behavior.
|
|
4615
4619
|
*/
|
|
4616
4620
|
getAutoAdapter(_strategy, _table) {
|
|
4617
4621
|
if (this.powerSyncAdapter) {
|
|
4618
|
-
return this.powerSyncAdapter;
|
|
4622
|
+
return this.syncTrackingAdapter ?? this.powerSyncAdapter;
|
|
4619
4623
|
}
|
|
4620
4624
|
if (this.supabaseAdapter) {
|
|
4621
|
-
|
|
4625
|
+
const isOnline = this.autoDetector?.getSyncStatus()?.isOnline ?? (typeof navigator !== "undefined" ? navigator.onLine : false);
|
|
4626
|
+
if (isOnline) {
|
|
4627
|
+
return this.supabaseAdapter;
|
|
4628
|
+
}
|
|
4629
|
+
throw new Error("Offline and PowerSync not ready. Wait for PowerSync initialization.");
|
|
4622
4630
|
}
|
|
4623
4631
|
throw new Error("No adapters available. Initialize PowerSync or Supabase.");
|
|
4624
4632
|
}
|
|
@@ -7984,4 +7992,4 @@ moment/moment.js:
|
|
|
7984
7992
|
(*! license : MIT *)
|
|
7985
7993
|
(*! momentjs.com *)
|
|
7986
7994
|
*/
|
|
7987
|
-
//# sourceMappingURL=chunk-
|
|
7995
|
+
//# sourceMappingURL=chunk-FZJX2FZS.js.map
|