defuss-db 1.1.0 → 1.1.1
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/client.cjs +3 -0
- package/dist/client.mjs +3 -0
- package/dist/server.cjs +6 -1
- package/dist/server.mjs +6 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -20,6 +20,9 @@ class DexieProvider {
|
|
|
20
20
|
* @param options - Dexie-specific configuration options.
|
|
21
21
|
*/
|
|
22
22
|
async connect(options = {}) {
|
|
23
|
+
if (this.db && this.isConnected()) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
23
26
|
const isNode = typeof process !== "undefined" && typeof process.versions === "object" && typeof process.versions.node !== "undefined";
|
|
24
27
|
if (isNode) {
|
|
25
28
|
await import('fake-indexeddb/auto');
|
package/dist/client.mjs
CHANGED
|
@@ -18,6 +18,9 @@ class DexieProvider {
|
|
|
18
18
|
* @param options - Dexie-specific configuration options.
|
|
19
19
|
*/
|
|
20
20
|
async connect(options = {}) {
|
|
21
|
+
if (this.db && this.isConnected()) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
21
24
|
const isNode = typeof process !== "undefined" && typeof process.versions === "object" && typeof process.versions.node !== "undefined";
|
|
22
25
|
if (isNode) {
|
|
23
26
|
await import('fake-indexeddb/auto');
|
package/dist/server.cjs
CHANGED
|
@@ -11,6 +11,9 @@ class LibsqlProvider {
|
|
|
11
11
|
* @param config - The libsql connection configuration.
|
|
12
12
|
*/
|
|
13
13
|
async connect(config) {
|
|
14
|
+
if (this.db && this.isConnected()) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
14
17
|
this.db = client.createClient(config);
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
@@ -441,7 +444,9 @@ class MongoProvider {
|
|
|
441
444
|
*/
|
|
442
445
|
async connect(options = {}) {
|
|
443
446
|
try {
|
|
444
|
-
if (this.
|
|
447
|
+
if (this.isConnected()) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
445
450
|
const connectionString = options.connectionString || this.connectionString;
|
|
446
451
|
const { client, db } = await connectToMongo(connectionString);
|
|
447
452
|
this.client = client;
|
package/dist/server.mjs
CHANGED
|
@@ -9,6 +9,9 @@ class LibsqlProvider {
|
|
|
9
9
|
* @param config - The libsql connection configuration.
|
|
10
10
|
*/
|
|
11
11
|
async connect(config) {
|
|
12
|
+
if (this.db && this.isConnected()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
12
15
|
this.db = createClient(config);
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
@@ -439,7 +442,9 @@ class MongoProvider {
|
|
|
439
442
|
*/
|
|
440
443
|
async connect(options = {}) {
|
|
441
444
|
try {
|
|
442
|
-
if (this.
|
|
445
|
+
if (this.isConnected()) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
443
448
|
const connectionString = options.connectionString || this.connectionString;
|
|
444
449
|
const { client, db } = await connectToMongo(connectionString);
|
|
445
450
|
this.client = client;
|