@rwillians/qx 0.1.7 → 0.1.8

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.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defineMigrations = void 0;
4
- const ora_1 = require("ora");
5
4
  const index_1 = require("./index");
6
5
  const migrations = (0, index_1.table)('migrations', t => ({
7
6
  id: t.string({ size: 36 }).primaryKey(),
@@ -13,7 +12,6 @@ const migrations = (0, index_1.table)('migrations', t => ({
13
12
  * @version 1
14
13
  */
15
14
  const defineMigrations = (migs) => async (db) => {
16
- let spinner;
17
15
  await index_1.create.table(migrations, { ifNotExists: true }).onto(db);
18
16
  for (const [id, migration] of Object.entries(migs)) {
19
17
  const alreadyMigrated = await (0, index_1.from)(migrations.as('m'))
@@ -21,14 +19,11 @@ const defineMigrations = (migs) => async (db) => {
21
19
  .exists(db);
22
20
  if (alreadyMigrated)
23
21
  continue;
24
- spinner ??= (0, ora_1.default)('running migrations...').start();
25
- spinner.text = `running migration ${id}...`;
26
22
  // @TODO run in a transaction
27
23
  await migration(db);
28
24
  await (0, index_1.into)(migrations)
29
25
  .insert({ id, migratedAt: new Date() })
30
26
  .run(db);
31
27
  }
32
- spinner?.stop();
33
28
  };
34
29
  exports.defineMigrations = defineMigrations;
@@ -1,4 +1,3 @@
1
- import ora from 'ora';
2
1
  import { create, expr, from, into, table } from './index';
3
2
  const migrations = table('migrations', t => ({
4
3
  id: t.string({ size: 36 }).primaryKey(),
@@ -10,7 +9,6 @@ const migrations = table('migrations', t => ({
10
9
  * @version 1
11
10
  */
12
11
  export const defineMigrations = (migs) => async (db) => {
13
- let spinner;
14
12
  await create.table(migrations, { ifNotExists: true }).onto(db);
15
13
  for (const [id, migration] of Object.entries(migs)) {
16
14
  const alreadyMigrated = await from(migrations.as('m'))
@@ -18,13 +16,10 @@ export const defineMigrations = (migs) => async (db) => {
18
16
  .exists(db);
19
17
  if (alreadyMigrated)
20
18
  continue;
21
- spinner ??= ora('running migrations...').start();
22
- spinner.text = `running migration ${id}...`;
23
19
  // @TODO run in a transaction
24
20
  await migration(db);
25
21
  await into(migrations)
26
22
  .insert({ id, migratedAt: new Date() })
27
23
  .run(db);
28
24
  }
29
- spinner?.stop();
30
25
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rwillians/qx",
3
3
  "description": "A teeny tiny ORM for SQLite.",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "author": "Rafael Willians <me@rwillians.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -56,7 +56,6 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@standard-schema/spec": "^1.0.0",
59
- "ora": "^9.0.0",
60
59
  "sql-highlight": "^6.1.0"
61
60
  },
62
61
  "devDependencies": {