@ocap/statedb-sqlite 1.29.14 → 1.29.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/esm/db.mjs +1 -0
- package/esm/interfaces.d.mts +2 -0
- package/esm/migrations/002-delegation-extensions.d.mts +7 -0
- package/esm/migrations/002-delegation-extensions.mjs +16 -0
- package/esm/migrations/index.mjs +9 -2
- package/lib/db.cjs +1 -0
- package/lib/interfaces.d.cts +2 -0
- package/lib/migrations/002-delegation-extensions.cjs +23 -0
- package/lib/migrations/002-delegation-extensions.d.cts +7 -0
- package/lib/migrations/index.cjs +9 -2
- package/package.json +6 -6
package/esm/db.mjs
CHANGED
package/esm/interfaces.d.mts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/002-delegation-extensions.ts
|
|
5
|
+
var _002_delegation_extensions_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
async function up(db) {
|
|
10
|
+
await sql`ALTER TABLE delegation ADD COLUMN deny TEXT`.execute(db);
|
|
11
|
+
await sql`ALTER TABLE delegation ADD COLUMN validUntil INTEGER DEFAULT 0`.execute(db);
|
|
12
|
+
}
|
|
13
|
+
async function down(_db) {}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { _002_delegation_extensions_exports, down, up };
|
package/esm/migrations/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _001_genesis_exports } from "./001-genesis.mjs";
|
|
2
|
+
import { _002_delegation_extensions_exports } from "./002-delegation-extensions.mjs";
|
|
2
3
|
import { Migrator } from "kysely";
|
|
3
4
|
|
|
4
5
|
//#region src/migrations/index.ts
|
|
@@ -29,7 +30,10 @@ var InMemoryMigrationProvider = class {
|
|
|
29
30
|
async function runMigrations(db) {
|
|
30
31
|
const { error, results } = await new Migrator({
|
|
31
32
|
db,
|
|
32
|
-
provider: new InMemoryMigrationProvider({
|
|
33
|
+
provider: new InMemoryMigrationProvider({
|
|
34
|
+
"001-genesis": _001_genesis_exports,
|
|
35
|
+
"002-delegation-extensions": _002_delegation_extensions_exports
|
|
36
|
+
})
|
|
33
37
|
}).migrateToLatest();
|
|
34
38
|
results?.forEach((it) => {
|
|
35
39
|
if (it.status === "Success") {} else if (it.status === "Error") console.error(`Migration "${it.migrationName}" failed`);
|
|
@@ -46,7 +50,10 @@ async function runMigrations(db) {
|
|
|
46
50
|
async function rollbackMigrations(db) {
|
|
47
51
|
const migrator = new Migrator({
|
|
48
52
|
db,
|
|
49
|
-
provider: new InMemoryMigrationProvider({
|
|
53
|
+
provider: new InMemoryMigrationProvider({
|
|
54
|
+
"001-genesis": _001_genesis_exports,
|
|
55
|
+
"002-delegation-extensions": _002_delegation_extensions_exports
|
|
56
|
+
})
|
|
50
57
|
});
|
|
51
58
|
let hasMore = true;
|
|
52
59
|
while (hasMore) {
|
package/lib/db.cjs
CHANGED
package/lib/interfaces.d.cts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let kysely = require("kysely");
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/002-delegation-extensions.ts
|
|
5
|
+
var _002_delegation_extensions_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
async function up(db) {
|
|
10
|
+
await kysely.sql`ALTER TABLE delegation ADD COLUMN deny TEXT`.execute(db);
|
|
11
|
+
await kysely.sql`ALTER TABLE delegation ADD COLUMN validUntil INTEGER DEFAULT 0`.execute(db);
|
|
12
|
+
}
|
|
13
|
+
async function down(_db) {}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
Object.defineProperty(exports, '_002_delegation_extensions_exports', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _002_delegation_extensions_exports;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
exports.down = down;
|
|
23
|
+
exports.up = up;
|
package/lib/migrations/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_migrations_001_genesis = require('./001-genesis.cjs');
|
|
3
|
+
const require_migrations_002_delegation_extensions = require('./002-delegation-extensions.cjs');
|
|
3
4
|
let kysely = require("kysely");
|
|
4
5
|
|
|
5
6
|
//#region src/migrations/index.ts
|
|
@@ -30,7 +31,10 @@ var InMemoryMigrationProvider = class {
|
|
|
30
31
|
async function runMigrations(db) {
|
|
31
32
|
const { error, results } = await new kysely.Migrator({
|
|
32
33
|
db,
|
|
33
|
-
provider: new InMemoryMigrationProvider({
|
|
34
|
+
provider: new InMemoryMigrationProvider({
|
|
35
|
+
"001-genesis": require_migrations_001_genesis._001_genesis_exports,
|
|
36
|
+
"002-delegation-extensions": require_migrations_002_delegation_extensions._002_delegation_extensions_exports
|
|
37
|
+
})
|
|
34
38
|
}).migrateToLatest();
|
|
35
39
|
results?.forEach((it) => {
|
|
36
40
|
if (it.status === "Success") {} else if (it.status === "Error") console.error(`Migration "${it.migrationName}" failed`);
|
|
@@ -47,7 +51,10 @@ async function runMigrations(db) {
|
|
|
47
51
|
async function rollbackMigrations(db) {
|
|
48
52
|
const migrator = new kysely.Migrator({
|
|
49
53
|
db,
|
|
50
|
-
provider: new InMemoryMigrationProvider({
|
|
54
|
+
provider: new InMemoryMigrationProvider({
|
|
55
|
+
"001-genesis": require_migrations_001_genesis._001_genesis_exports,
|
|
56
|
+
"002-delegation-extensions": require_migrations_002_delegation_extensions._002_delegation_extensions_exports
|
|
57
|
+
})
|
|
51
58
|
});
|
|
52
59
|
let hasMore = true;
|
|
53
60
|
while (hasMore) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/statedb-sqlite",
|
|
3
3
|
"description": "OCAP statedb adapter that uses SQLite as backend",
|
|
4
|
-
"version": "1.29.
|
|
4
|
+
"version": "1.29.16",
|
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ArcBlock/blockchain/issues",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ocap/statedb-test": "1.29.
|
|
17
|
+
"@ocap/statedb-test": "1.29.16"
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/statedb/sqlite",
|
|
20
20
|
"keywords": [
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"clean": "rm -rf lib esm"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@ocap/state": "1.29.
|
|
67
|
-
"@ocap/statedb": "1.29.
|
|
68
|
-
"@ocap/types": "1.29.
|
|
69
|
-
"@ocap/util": "1.29.
|
|
66
|
+
"@ocap/state": "1.29.16",
|
|
67
|
+
"@ocap/statedb": "1.29.16",
|
|
68
|
+
"@ocap/types": "1.29.16",
|
|
69
|
+
"@ocap/util": "1.29.16",
|
|
70
70
|
"debug": "^4.4.3",
|
|
71
71
|
"better-sqlite3": "^11.8.1",
|
|
72
72
|
"kysely": "^0.27.0",
|