@neetru/sdk 2.3.5 → 2.3.6
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/CHANGELOG.md +12 -0
- package/dist/auth.cjs +8 -2
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +8 -2
- package/dist/auth.mjs.map +1 -1
- package/dist/db.cjs +8 -2
- package/dist/db.cjs.map +1 -1
- package/dist/db.mjs +8 -2
- package/dist/db.mjs.map +1 -1
- package/dist/index.cjs +24 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -6
- package/dist/index.mjs.map +1 -1
- package/dist/mocks.cjs +16 -4
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.mjs +16 -4
- package/dist/mocks.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -448,7 +448,10 @@ function parseLease(raw) {
|
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
450
|
async function createPgPool(lease) {
|
|
451
|
-
const { Pool } = await import(
|
|
451
|
+
const { Pool } = await import(
|
|
452
|
+
/* webpackIgnore: true */
|
|
453
|
+
'pg'
|
|
454
|
+
);
|
|
452
455
|
const ssl = lease.sslca ? {
|
|
453
456
|
ca: lease.sslca,
|
|
454
457
|
cert: lease.clientCert ?? void 0,
|
|
@@ -468,7 +471,10 @@ async function createPgPool(lease) {
|
|
|
468
471
|
});
|
|
469
472
|
}
|
|
470
473
|
async function createDrizzleHandle(pool, schema) {
|
|
471
|
-
const { drizzle } = await import(
|
|
474
|
+
const { drizzle } = await import(
|
|
475
|
+
/* webpackIgnore: true */
|
|
476
|
+
'drizzle-orm/node-postgres'
|
|
477
|
+
);
|
|
472
478
|
return drizzle(pool, { schema });
|
|
473
479
|
}
|
|
474
480
|
async function createSqlClientWithDeps(deps, options) {
|
|
@@ -5457,8 +5463,14 @@ var MockDb = class {
|
|
|
5457
5463
|
async sql(schema, options) {
|
|
5458
5464
|
const ddls = options?.initSql ? Array.isArray(options.initSql) ? options.initSql : [options.initSql] : [];
|
|
5459
5465
|
try {
|
|
5460
|
-
const pglitePkg = await import(
|
|
5461
|
-
|
|
5466
|
+
const pglitePkg = await import(
|
|
5467
|
+
/* webpackIgnore: true */
|
|
5468
|
+
'@electric-sql/pglite'
|
|
5469
|
+
);
|
|
5470
|
+
const drizzlePglitePkg = await import(
|
|
5471
|
+
/* webpackIgnore: true */
|
|
5472
|
+
'drizzle-orm/pglite'
|
|
5473
|
+
);
|
|
5462
5474
|
const pglite = await pglitePkg.PGlite.create();
|
|
5463
5475
|
for (const ddl of ddls) {
|
|
5464
5476
|
await pglite.query(ddl);
|
|
@@ -5479,8 +5491,14 @@ var MockDb = class {
|
|
|
5479
5491
|
let pgMemMod;
|
|
5480
5492
|
let drizzlePg;
|
|
5481
5493
|
try {
|
|
5482
|
-
pgMemMod = await import(
|
|
5483
|
-
|
|
5494
|
+
pgMemMod = await import(
|
|
5495
|
+
/* webpackIgnore: true */
|
|
5496
|
+
'pg-mem'
|
|
5497
|
+
);
|
|
5498
|
+
drizzlePg = await import(
|
|
5499
|
+
/* webpackIgnore: true */
|
|
5500
|
+
'drizzle-orm/node-postgres'
|
|
5501
|
+
);
|
|
5484
5502
|
} catch {
|
|
5485
5503
|
throw new NeetruDbError(
|
|
5486
5504
|
"db_unavailable",
|