imodel 0.20.0 → 0.20.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/index.d.mts +1481 -1888
- package/index.mjs +125 -564
- package/migrate.d.mts +1 -1
- package/migrate.mjs +10 -10
- package/package.json +1 -1
package/migrate.d.mts
CHANGED
package/migrate.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* imodel v0.20.
|
|
2
|
+
* imodel v0.20.1
|
|
3
3
|
* (c) 2019-2026 猛火Fierflame
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { now, Query, define } from 'imodel';
|
|
7
|
+
import { now, Query, define, actions } from 'imodel';
|
|
8
8
|
|
|
9
9
|
/** @import { Connection } from 'imodel' */
|
|
10
10
|
/** @typedef {import('./index.mjs').Migrator} Migrator */
|
|
@@ -1220,10 +1220,10 @@ async function run(t, info, group, revert) {
|
|
|
1220
1220
|
title,
|
|
1221
1221
|
list
|
|
1222
1222
|
} = info;
|
|
1223
|
-
const res = await t.first(TableMigration.where({
|
|
1223
|
+
const res = await t.call(actions.first(TableMigration.where({
|
|
1224
1224
|
group,
|
|
1225
1225
|
no
|
|
1226
|
-
}));
|
|
1226
|
+
})));
|
|
1227
1227
|
if (!revert !== !res) {
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
@@ -1234,15 +1234,15 @@ async function run(t, info, group, revert) {
|
|
|
1234
1234
|
const migrators = 'default' in value ? value.default || value : value;
|
|
1235
1235
|
await create(t, migrators, console.log, revert);
|
|
1236
1236
|
if (revert) {
|
|
1237
|
-
await t.destroyMany(TableMigration.where({
|
|
1237
|
+
await t.call(actions.destroyMany(TableMigration.where({
|
|
1238
1238
|
group,
|
|
1239
1239
|
no
|
|
1240
|
-
}));
|
|
1240
|
+
})));
|
|
1241
1241
|
} else {
|
|
1242
|
-
await t.create(TableMigration, {
|
|
1242
|
+
await t.call(actions.create(TableMigration, {
|
|
1243
1243
|
group,
|
|
1244
1244
|
no: BigInt(no)
|
|
1245
|
-
});
|
|
1245
|
+
}));
|
|
1246
1246
|
}
|
|
1247
1247
|
} finally {
|
|
1248
1248
|
console.groupEnd();
|
|
@@ -1338,7 +1338,7 @@ async function initMigrate(connection, list, init, group) {
|
|
|
1338
1338
|
group,
|
|
1339
1339
|
no: BigInt(no)
|
|
1340
1340
|
}));
|
|
1341
|
-
return connection.create(TableMigration, noList);
|
|
1341
|
+
return connection.call(actions.create(TableMigration, noList));
|
|
1342
1342
|
}
|
|
1343
1343
|
/**
|
|
1344
1344
|
*
|
|
@@ -1390,7 +1390,7 @@ async function auto (runTransaction, migrations, {
|
|
|
1390
1390
|
const noQuery = TableMigration.where({
|
|
1391
1391
|
group: g
|
|
1392
1392
|
});
|
|
1393
|
-
const n = await runTransaction(t => t.count(noQuery));
|
|
1393
|
+
const n = await runTransaction(t => t.call(actions.count(noQuery)));
|
|
1394
1394
|
if (n) {
|
|
1395
1395
|
return autoMigrate(runTransaction, up, down, g);
|
|
1396
1396
|
}
|