@power-bots/powerbotlibrary 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/db.js +2 -1
  2. package/package.json +1 -1
package/dist/db.js CHANGED
@@ -18,6 +18,7 @@ exports.updateDatabase = updateDatabase;
18
18
  const node_path_1 = __importDefault(require("node:path"));
19
19
  const node_fs_1 = __importDefault(require("node:fs"));
20
20
  const main_1 = require("./main");
21
+ let rawDb;
21
22
  function setupDatabase() {
22
23
  return __awaiter(this, void 0, void 0, function* () {
23
24
  exports.knex = require("knex")({
@@ -28,6 +29,7 @@ function setupDatabase() {
28
29
  useNullAsDefault: true,
29
30
  pool: {
30
31
  afterCreate: (conn, done) => {
32
+ rawDb = conn;
31
33
  conn.pragma('journal_mode = WAL');
32
34
  done(null, conn);
33
35
  }
@@ -43,7 +45,6 @@ function updateDatabase() {
43
45
  return;
44
46
  let updating = true;
45
47
  let nextVersion = userVersion;
46
- const rawDb = yield exports.knex.client.acquireConnection();
47
48
  while (updating) {
48
49
  nextVersion = nextVersion + 1;
49
50
  const nextVersionFile = node_path_1.default.join(migrateFolder, `${nextVersion}.sql`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@power-bots/powerbotlibrary",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/main.d.ts",
6
6
  "dependencies": {