rads-db 3.2.14 → 3.2.16

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/drivers/sql.cjs CHANGED
@@ -377,6 +377,7 @@ ${insertQuery.slice(0, 300)}...`);
377
377
  await client.query(`delete from ${entity}`);
378
378
  return [];
379
379
  },
380
+ ensureClientConnected,
380
381
  /** Generates migration script for this one entity */
381
382
  async generateMigrationScript() {
382
383
  await ensureIntrospectionIsAvailable();
@@ -720,12 +721,12 @@ END;
720
721
  await clientPromise;
721
722
  }
722
723
  async function ensureClientConnectedInner() {
723
- client = await _mssql.default.connect({
724
+ client = await new _mssql.default.ConnectionPool({
724
725
  authentication: options.authentication,
725
726
  server: options.server,
726
727
  database: options.database,
727
728
  ...options.options
728
- });
729
+ }).connect();
729
730
  }
730
731
  };
731
732
  module.exports = _default;
package/drivers/sql.mjs CHANGED
@@ -248,6 +248,7 @@ ${insertQuery.slice(0, 300)}...`);
248
248
  await client.query(`delete from ${entity}`);
249
249
  return [];
250
250
  },
251
+ ensureClientConnected,
251
252
  /** Generates migration script for this one entity */
252
253
  async generateMigrationScript() {
253
254
  await ensureIntrospectionIsAvailable();
@@ -596,12 +597,12 @@ END;
596
597
  await clientPromise;
597
598
  }
598
599
  async function ensureClientConnectedInner() {
599
- client = await sql.connect({
600
+ client = await new sql.ConnectionPool({
600
601
  authentication: options.authentication,
601
602
  server: options.server,
602
603
  database: options.database,
603
604
  ...options.options
604
- });
605
+ }).connect();
605
606
  }
606
607
  };
607
608
  function stringifyValueForInsert(value) {
@@ -113,7 +113,6 @@ function getEffectFor(entityName, aggregateRelationField, eventEntityName, schem
113
113
  updatedEvents: v.updatedEvents,
114
114
  oldDoc: v.oldAggDoc
115
115
  }));
116
- console.log(ctx);
117
116
  const aggregateEffectContext = {
118
117
  ...context,
119
118
  typeName: entityName,
@@ -97,7 +97,6 @@ function getEffectFor(entityName, aggregateRelationField, eventEntityName, schem
97
97
  updatedEvents: v.updatedEvents,
98
98
  oldDoc: v.oldAggDoc
99
99
  }));
100
- console.log(ctx);
101
100
  const aggregateEffectContext = { ...context, typeName: entityName, handle: schema[entityName].handle };
102
101
  await beforePut(hookItems, ctx, aggregateEffectContext);
103
102
  await context.drivers[entityName].putMany(aggs, ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.2.14",
3
+ "version": "3.2.16",
4
4
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
5
5
  "author": "",
6
6
  "license": "ISC",