@ocap/indexdb-sqlite 1.30.24 → 1.30.26
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/base.mjs +14 -2
- package/esm/db/index.d.mts +1 -0
- package/esm/db/index.mjs +21 -1
- package/esm/index.d.mts +2 -1
- package/esm/index.mjs +2 -1
- package/esm/interfaces.d.mts +18 -2
- package/esm/kysely.d.mts +67 -7
- package/esm/kysely.mjs +1526 -16
- package/esm/migrations/001-genesis.mjs +1 -1
- package/esm/migrations/007-token-factory-feerate-integer.d.mts +7 -0
- package/esm/migrations/007-token-factory-feerate-integer.mjs +126 -0
- package/esm/migrations/008-index-failure.d.mts +14 -0
- package/esm/migrations/008-index-failure.mjs +25 -0
- package/esm/migrations/index.mjs +5 -1
- package/esm/package.mjs +1 -1
- package/lib/db/base.cjs +14 -2
- package/lib/db/index.cjs +21 -1
- package/lib/db/index.d.cts +1 -0
- package/lib/index.cjs +4 -1
- package/lib/index.d.cts +2 -1
- package/lib/interfaces.d.cts +18 -2
- package/lib/kysely.cjs +1528 -15
- package/lib/kysely.d.cts +67 -7
- package/lib/migrations/001-genesis.cjs +1 -1
- package/lib/migrations/007-token-factory-feerate-integer.cjs +133 -0
- package/lib/migrations/007-token-factory-feerate-integer.d.cts +7 -0
- package/lib/migrations/008-index-failure.cjs +32 -0
- package/lib/migrations/008-index-failure.d.cts +14 -0
- package/lib/migrations/index.cjs +5 -1
- package/lib/package.cjs +1 -1
- package/package.json +8 -6
package/lib/kysely.d.cts
CHANGED
|
@@ -1,22 +1,70 @@
|
|
|
1
1
|
import { Database } from "./interfaces.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { ITrustedStorage } from "@ocap/types";
|
|
3
|
+
import { DatabaseConnection, Dialect, Driver, Kysely, SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler } from "kysely";
|
|
3
4
|
|
|
4
5
|
//#region src/kysely.d.ts
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Minimal Cloudflare Durable Object `SqlStorageCursor` contract (`ctx.storage.sql.exec(...)`).
|
|
9
|
+
*/
|
|
10
|
+
interface IDurableObjectSqlStorageCursor<T = Record<string, unknown>> {
|
|
11
|
+
toArray(): T[];
|
|
12
|
+
one?(): T;
|
|
13
|
+
raw?<U = unknown[]>(): IterableIterator<U> | U[];
|
|
14
|
+
columnNames?: string[];
|
|
15
|
+
rowsRead?: number;
|
|
16
|
+
rowsWritten?: number;
|
|
17
|
+
[Symbol.iterator]?(): IterableIterator<T>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Minimal Cloudflare Durable Object `SqlStorage` contract (`ctx.storage.sql`).
|
|
21
|
+
*/
|
|
22
|
+
interface IDurableObjectSqlStorage {
|
|
23
|
+
exec<T = Record<string, unknown>>(query: string, ...bindings: unknown[]): IDurableObjectSqlStorageCursor<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Optional Durable Object runtime transaction closure (`ctx.storage.transaction.bind(ctx.storage)`).
|
|
26
|
+
* When omitted, `DurableObjectSqliteDialect` still provides full atomic rollback via
|
|
27
|
+
* per-statement SQLite trigger undo logs and crash-recovery metadata without emitting
|
|
28
|
+
* forbidden BEGIN/SAVEPOINT SQL.
|
|
29
|
+
*/
|
|
30
|
+
transaction?<T>(closure: () => Promise<T>): Promise<T>;
|
|
31
|
+
databaseSize?: number;
|
|
32
|
+
}
|
|
33
|
+
interface DurableObjectSqliteDialectConfig {
|
|
34
|
+
storage: IDurableObjectSqlStorage;
|
|
35
|
+
onCreateConnection?: (connection: DatabaseConnection) => Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
declare function getDoStorageWriteEpoch(storage: IDurableObjectSqlStorage): number;
|
|
38
|
+
/**
|
|
39
|
+
* Kysely Dialect for Cloudflare Durable Object SQLite (`ctx.storage.sql`).
|
|
40
|
+
*/
|
|
41
|
+
declare class DurableObjectSqliteDialect implements Dialect {
|
|
42
|
+
private readonly config;
|
|
43
|
+
private readonly createdOrder;
|
|
44
|
+
constructor(config: DurableObjectSqliteDialectConfig);
|
|
45
|
+
createDriver(): Driver;
|
|
46
|
+
createQueryCompiler(): SqliteQueryCompiler;
|
|
47
|
+
createAdapter(): SqliteAdapter;
|
|
48
|
+
createIntrospector(db: Kysely<any>): SqliteIntrospector;
|
|
49
|
+
}
|
|
6
50
|
/**
|
|
7
51
|
* SQLite configuration options
|
|
8
52
|
*/
|
|
9
53
|
interface SqliteConfig {
|
|
10
54
|
/** Database file path. Use ':memory:' for in-memory database */
|
|
11
|
-
filename
|
|
55
|
+
filename?: string;
|
|
56
|
+
/** Cloudflare Durable Object `ctx.storage.sql` instance */
|
|
57
|
+
doStorage?: IDurableObjectSqlStorage;
|
|
58
|
+
/** Custom Kysely Dialect override */
|
|
59
|
+
dialect?: Dialect;
|
|
60
|
+
/** Optional trusted storage instance for state commit hash verification */
|
|
61
|
+
trustedStorage?: ITrustedStorage;
|
|
12
62
|
/** Open database in readonly mode */
|
|
13
63
|
readonly?: boolean;
|
|
14
64
|
/** Throw error if file doesn't exist (default: false, creates new file) */
|
|
15
65
|
create?: boolean;
|
|
16
66
|
/** Enable WAL mode (default: true) */
|
|
17
67
|
walMode?: boolean;
|
|
18
|
-
/** Busy timeout in ms (default: SQLITE_BUSY_TIMEOUT env or 5000) */
|
|
19
|
-
busyTimeout?: number;
|
|
20
68
|
/**
|
|
21
69
|
* `PRAGMA wal_autocheckpoint` value (in 4KB pages) when WAL is enabled.
|
|
22
70
|
* SQLite default is 1000 pages (~4MB) which forces a synchronous WAL→main
|
|
@@ -29,10 +77,22 @@ interface SqliteConfig {
|
|
|
29
77
|
* provided. If neither is set, SQLite's default (1000) is left untouched.
|
|
30
78
|
*/
|
|
31
79
|
walAutoCheckpoint?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Optional interval (in ms) for a background passive WAL checkpoint worker
|
|
82
|
+
* (`PRAGMA wal_checkpoint(PASSIVE)`). When > 0 and WAL mode is enabled, a
|
|
83
|
+
* non-blocking (`unref()`ed) periodic timer checkpoints frames back to the
|
|
84
|
+
* main DB file out-of-band without blocking readers or writers.
|
|
85
|
+
*
|
|
86
|
+
* Falls back to `SQLITE_WAL_CHECKPOINT_INTERVAL_MS` env when not provided.
|
|
87
|
+
* Disabled by default (0 / undefined).
|
|
88
|
+
*/
|
|
89
|
+
walCheckpointIntervalMs?: number;
|
|
32
90
|
}
|
|
91
|
+
declare function resolveWalCheckpointIntervalMs(config: SqliteConfig): number | undefined;
|
|
33
92
|
/**
|
|
34
93
|
* Create a Kysely instance with SQLite dialect
|
|
35
|
-
* Automatically uses
|
|
94
|
+
* Automatically uses DurableObjectSqliteDialect when `config.doStorage` is provided,
|
|
95
|
+
* custom `config.dialect` when provided, kysely-bun-sqlite in Bun, or better-sqlite3 in Node.js
|
|
36
96
|
*
|
|
37
97
|
* @param config - SQLite configuration
|
|
38
98
|
* @returns Kysely instance configured for the database
|
|
@@ -43,7 +103,7 @@ interface SqliteConfig {
|
|
|
43
103
|
* const db = createKysely({ filename: ':memory:' });
|
|
44
104
|
*
|
|
45
105
|
* // File-based database for production
|
|
46
|
-
* const db = createKysely({ filename: './data/
|
|
106
|
+
* const db = createKysely({ filename: './data/state.sqlite' });
|
|
47
107
|
* ```
|
|
48
108
|
*/
|
|
49
109
|
declare function createKysely(config: SqliteConfig): Kysely<Database>;
|
|
@@ -54,4 +114,4 @@ declare function createKysely(config: SqliteConfig): Kysely<Database>;
|
|
|
54
114
|
*/
|
|
55
115
|
declare function getRawDatabase(db: Kysely<Database>): any;
|
|
56
116
|
//#endregion
|
|
57
|
-
export { SqliteConfig, createKysely, getRawDatabase };
|
|
117
|
+
export { DurableObjectSqliteDialect, DurableObjectSqliteDialectConfig, IDurableObjectSqlStorage, IDurableObjectSqlStorageCursor, SqliteConfig, createKysely, getDoStorageWriteEpoch, getRawDatabase, resolveWalCheckpointIntervalMs };
|
|
@@ -41,7 +41,7 @@ async function up(db) {
|
|
|
41
41
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_factory_minted ON factory(numMinted)`.execute(db);
|
|
42
42
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_factory_limit ON factory(limit_)`.execute(db);
|
|
43
43
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_factory_name ON factory(name)`.execute(db);
|
|
44
|
-
await db.schema.createTable("tokenFactory").ifNotExists().addColumn("address", "text", (col) => col.primaryKey()).addColumn("owner", "text").addColumn("name", "text").addColumn("description", "text").addColumn("moniker", "text").addColumn("status", "text").addColumn("curve", "text").addColumn("tokenAddress", "text").addColumn("reserveAddress", "text").addColumn("reserveBalance", "text").addColumn("reserveBalanceNum", "text").addColumn("currentSupply", "text").addColumn("currentSupplyNum", "text").addColumn("feeRate", "
|
|
44
|
+
await db.schema.createTable("tokenFactory").ifNotExists().addColumn("address", "text", (col) => col.primaryKey()).addColumn("owner", "text").addColumn("name", "text").addColumn("description", "text").addColumn("moniker", "text").addColumn("status", "text").addColumn("curve", "text").addColumn("tokenAddress", "text").addColumn("reserveAddress", "text").addColumn("reserveBalance", "text").addColumn("reserveBalanceNum", "text").addColumn("currentSupply", "text").addColumn("currentSupplyNum", "text").addColumn("feeRate", "integer").addColumn("token", "text").addColumn("reserveToken", "text").addColumn("input", "text").addColumn("output", "text").addColumn("data", "text").addColumn("genesisTime", "text").addColumn("renaissanceTime", "text").execute();
|
|
45
45
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner ON tokenFactory(owner)`.execute(db);
|
|
46
46
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_token ON tokenFactory(tokenAddress)`.execute(db);
|
|
47
47
|
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve ON tokenFactory(reserveAddress)`.execute(db);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let kysely = require("kysely");
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/007-token-factory-feerate-integer.ts
|
|
5
|
+
var _007_token_factory_feerate_integer_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
async function assertTokenFactoryTableExists(db) {
|
|
10
|
+
if ((await kysely.sql`
|
|
11
|
+
SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'tokenFactory'
|
|
12
|
+
`.execute(db)).rows.length === 0) throw new Error("Cannot migrate tokenFactory.feeRate: source table tokenFactory is missing. Refusing to create an empty tokenFactory index table; restore or reindex tokenFactory before rerunning this migration.");
|
|
13
|
+
}
|
|
14
|
+
async function getTokenFactoryCount(db, table) {
|
|
15
|
+
const result = table === "tokenFactory" ? await kysely.sql`SELECT COUNT(*) AS count FROM tokenFactory`.execute(db) : await kysely.sql`SELECT COUNT(*) AS count FROM tokenFactory_new`.execute(db);
|
|
16
|
+
return Number(result.rows[0]?.count ?? 0);
|
|
17
|
+
}
|
|
18
|
+
async function createTokenFactoryIndexes(db) {
|
|
19
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner ON tokenFactory(owner)`.execute(db);
|
|
20
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_token ON tokenFactory(tokenAddress)`.execute(db);
|
|
21
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve ON tokenFactory(reserveAddress)`.execute(db);
|
|
22
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_genesis ON tokenFactory(genesisTime)`.execute(db);
|
|
23
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_renaissance ON tokenFactory(renaissanceTime)`.execute(db);
|
|
24
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_reserve_balance ON tokenFactory(reserveBalanceNum)`.execute(db);
|
|
25
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_supply ON tokenFactory(currentSupplyNum)`.execute(db);
|
|
26
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_owner_renaissance ON tokenFactory(owner, renaissanceTime DESC)`.execute(db);
|
|
27
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_tokenfactory_name ON tokenFactory(name) WHERE name IS NOT NULL`.execute(db);
|
|
28
|
+
}
|
|
29
|
+
async function up(db) {
|
|
30
|
+
await assertTokenFactoryTableExists(db);
|
|
31
|
+
const beforeCount = await getTokenFactoryCount(db, "tokenFactory");
|
|
32
|
+
await kysely.sql`DROP TABLE IF EXISTS tokenFactory_new`.execute(db);
|
|
33
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_owner`.execute(db);
|
|
34
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_token`.execute(db);
|
|
35
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_reserve`.execute(db);
|
|
36
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_genesis`.execute(db);
|
|
37
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_renaissance`.execute(db);
|
|
38
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_reserve_balance`.execute(db);
|
|
39
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_supply`.execute(db);
|
|
40
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_owner_renaissance`.execute(db);
|
|
41
|
+
await kysely.sql`DROP INDEX IF EXISTS idx_tokenfactory_name`.execute(db);
|
|
42
|
+
await kysely.sql`
|
|
43
|
+
CREATE TABLE tokenFactory_new (
|
|
44
|
+
address TEXT PRIMARY KEY,
|
|
45
|
+
owner TEXT,
|
|
46
|
+
name TEXT,
|
|
47
|
+
description TEXT,
|
|
48
|
+
moniker TEXT,
|
|
49
|
+
status TEXT,
|
|
50
|
+
curve TEXT,
|
|
51
|
+
tokenAddress TEXT,
|
|
52
|
+
reserveAddress TEXT,
|
|
53
|
+
reserveBalance TEXT,
|
|
54
|
+
reserveBalanceNum TEXT,
|
|
55
|
+
currentSupply TEXT,
|
|
56
|
+
currentSupplyNum TEXT,
|
|
57
|
+
feeRate INTEGER,
|
|
58
|
+
token TEXT,
|
|
59
|
+
reserveToken TEXT,
|
|
60
|
+
input TEXT,
|
|
61
|
+
output TEXT,
|
|
62
|
+
data TEXT,
|
|
63
|
+
genesisTime TEXT,
|
|
64
|
+
renaissanceTime TEXT
|
|
65
|
+
)
|
|
66
|
+
`.execute(db);
|
|
67
|
+
await kysely.sql`
|
|
68
|
+
INSERT INTO tokenFactory_new (
|
|
69
|
+
address,
|
|
70
|
+
owner,
|
|
71
|
+
name,
|
|
72
|
+
description,
|
|
73
|
+
moniker,
|
|
74
|
+
status,
|
|
75
|
+
curve,
|
|
76
|
+
tokenAddress,
|
|
77
|
+
reserveAddress,
|
|
78
|
+
reserveBalance,
|
|
79
|
+
reserveBalanceNum,
|
|
80
|
+
currentSupply,
|
|
81
|
+
currentSupplyNum,
|
|
82
|
+
feeRate,
|
|
83
|
+
token,
|
|
84
|
+
reserveToken,
|
|
85
|
+
input,
|
|
86
|
+
output,
|
|
87
|
+
data,
|
|
88
|
+
genesisTime,
|
|
89
|
+
renaissanceTime
|
|
90
|
+
)
|
|
91
|
+
SELECT
|
|
92
|
+
address,
|
|
93
|
+
owner,
|
|
94
|
+
name,
|
|
95
|
+
description,
|
|
96
|
+
moniker,
|
|
97
|
+
status,
|
|
98
|
+
curve,
|
|
99
|
+
tokenAddress,
|
|
100
|
+
reserveAddress,
|
|
101
|
+
reserveBalance,
|
|
102
|
+
reserveBalanceNum,
|
|
103
|
+
currentSupply,
|
|
104
|
+
currentSupplyNum,
|
|
105
|
+
CASE WHEN feeRate IS NULL OR feeRate = '' THEN NULL ELSE CAST(feeRate AS INTEGER) END,
|
|
106
|
+
token,
|
|
107
|
+
reserveToken,
|
|
108
|
+
input,
|
|
109
|
+
output,
|
|
110
|
+
data,
|
|
111
|
+
genesisTime,
|
|
112
|
+
renaissanceTime
|
|
113
|
+
FROM tokenFactory
|
|
114
|
+
`.execute(db);
|
|
115
|
+
const stagedCount = await getTokenFactoryCount(db, "tokenFactory_new");
|
|
116
|
+
if (stagedCount !== beforeCount) throw new Error(`Cannot migrate tokenFactory.feeRate: staged row count mismatch before replacing table (${stagedCount} !== ${beforeCount})`);
|
|
117
|
+
await kysely.sql`DROP TABLE tokenFactory`.execute(db);
|
|
118
|
+
await kysely.sql`ALTER TABLE tokenFactory_new RENAME TO tokenFactory`.execute(db);
|
|
119
|
+
await createTokenFactoryIndexes(db);
|
|
120
|
+
const afterCount = await getTokenFactoryCount(db, "tokenFactory");
|
|
121
|
+
if (afterCount !== beforeCount) throw new Error(`Cannot migrate tokenFactory.feeRate: row count mismatch after replacing table (${afterCount} !== ${beforeCount})`);
|
|
122
|
+
}
|
|
123
|
+
async function down(_db) {}
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
Object.defineProperty(exports, '_007_token_factory_feerate_integer_exports', {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _007_token_factory_feerate_integer_exports;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
exports.down = down;
|
|
133
|
+
exports.up = up;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let kysely = require("kysely");
|
|
3
|
+
|
|
4
|
+
//#region src/migrations/008-index-failure.ts
|
|
5
|
+
var _008_index_failure_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
6
|
+
down: () => down,
|
|
7
|
+
up: () => up
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Adds the indexFailure table: a durable log of failed indexdb writes from
|
|
11
|
+
* connectIndexDB()'s statedb event listeners (see #67). `table` is a reserved SQL
|
|
12
|
+
* keyword, so the column is `table_` (mapped from the `table` JS field via columnMapping,
|
|
13
|
+
* matching the existing `index`/`limit`/`from`/`to` convention in this schema).
|
|
14
|
+
*/
|
|
15
|
+
async function up(db) {
|
|
16
|
+
await db.schema.createTable("indexFailure").ifNotExists().addColumn("id", "text", (col) => col.primaryKey()).addColumn("table_", "text", (col) => col.notNull()).addColumn("event", "text", (col) => col.notNull()).addColumn("entityId", "text").addColumn("payload", "text").addColumn("attempts", "integer", (col) => col.notNull().defaultTo(0)).addColumn("lastError", "text").addColumn("createdAt", "text", (col) => col.notNull()).addColumn("lastAttemptAt", "text", (col) => col.notNull()).execute();
|
|
17
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_indexFailure_table ON indexFailure(table_)`.execute(db);
|
|
18
|
+
await kysely.sql`CREATE INDEX IF NOT EXISTS idx_indexFailure_createdAt ON indexFailure(createdAt)`.execute(db);
|
|
19
|
+
}
|
|
20
|
+
async function down(db) {
|
|
21
|
+
await db.schema.dropTable("indexFailure").ifExists().execute();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
Object.defineProperty(exports, '_008_index_failure_exports', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _008_index_failure_exports;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
exports.down = down;
|
|
32
|
+
exports.up = up;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Kysely } from "kysely";
|
|
2
|
+
|
|
3
|
+
//#region src/migrations/008-index-failure.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Adds the indexFailure table: a durable log of failed indexdb writes from
|
|
7
|
+
* connectIndexDB()'s statedb event listeners (see #67). `table` is a reserved SQL
|
|
8
|
+
* keyword, so the column is `table_` (mapped from the `table` JS field via columnMapping,
|
|
9
|
+
* matching the existing `index`/`limit`/`from`/`to` convention in this schema).
|
|
10
|
+
*/
|
|
11
|
+
declare function up(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
declare function down(db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { down, up };
|
package/lib/migrations/index.cjs
CHANGED
|
@@ -5,6 +5,8 @@ const require_migrations_003_delegation_extensions = require('./003-delegation-e
|
|
|
5
5
|
const require_migrations_004_search_indexes = require('./004-search-indexes.cjs');
|
|
6
6
|
const require_migrations_005_rollup_missing_columns = require('./005-rollup-missing-columns.cjs');
|
|
7
7
|
const require_migrations_006_rollup_block_height_integer = require('./006-rollup-block-height-integer.cjs');
|
|
8
|
+
const require_migrations_007_token_factory_feerate_integer = require('./007-token-factory-feerate-integer.cjs');
|
|
9
|
+
const require_migrations_008_index_failure = require('./008-index-failure.cjs');
|
|
8
10
|
let kysely = require("kysely");
|
|
9
11
|
|
|
10
12
|
//#region src/migrations/index.ts
|
|
@@ -20,7 +22,9 @@ var InMemoryMigrationProvider = class {
|
|
|
20
22
|
"003-delegation-extensions": require_migrations_003_delegation_extensions._003_delegation_extensions_exports,
|
|
21
23
|
"004-search-indexes": require_migrations_004_search_indexes._004_search_indexes_exports,
|
|
22
24
|
"005-rollup-missing-columns": require_migrations_005_rollup_missing_columns._005_rollup_missing_columns_exports,
|
|
23
|
-
"006-rollup-block-height-integer": require_migrations_006_rollup_block_height_integer._006_rollup_block_height_integer_exports
|
|
25
|
+
"006-rollup-block-height-integer": require_migrations_006_rollup_block_height_integer._006_rollup_block_height_integer_exports,
|
|
26
|
+
"007-token-factory-feerate-integer": require_migrations_007_token_factory_feerate_integer._007_token_factory_feerate_integer_exports,
|
|
27
|
+
"008-index-failure": require_migrations_008_index_failure._008_index_failure_exports
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
};
|
package/lib/package.cjs
CHANGED
|
@@ -11,7 +11,7 @@ var package_default = {
|
|
|
11
11
|
},
|
|
12
12
|
publishConfig: { "access": "public" },
|
|
13
13
|
contributors: ["wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"],
|
|
14
|
-
devDependencies: {},
|
|
14
|
+
devDependencies: { "@ocap/indexdb-test": "workspace:*" },
|
|
15
15
|
homepage: "https://github.com/ArcBlock/blockchain/tree/master/indexdb/sqlite",
|
|
16
16
|
keywords: [
|
|
17
17
|
"ocap",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-sqlite",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses SQLite as backend",
|
|
4
|
-
"version": "1.30.
|
|
4
|
+
"version": "1.30.26",
|
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ArcBlock/blockchain/issues",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"contributors": [
|
|
14
14
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
15
15
|
],
|
|
16
|
-
"devDependencies": {
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@ocap/indexdb-test": "1.30.26"
|
|
18
|
+
},
|
|
17
19
|
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/indexdb/sqlite",
|
|
18
20
|
"keywords": [
|
|
19
21
|
"ocap",
|
|
@@ -61,10 +63,10 @@
|
|
|
61
63
|
"clean": "rm -rf lib esm"
|
|
62
64
|
},
|
|
63
65
|
"dependencies": {
|
|
64
|
-
"@arcblock/did": "1.30.
|
|
65
|
-
"@ocap/indexdb": "1.30.
|
|
66
|
-
"@ocap/types": "1.30.
|
|
67
|
-
"@ocap/util": "1.30.
|
|
66
|
+
"@arcblock/did": "1.30.26",
|
|
67
|
+
"@ocap/indexdb": "1.30.26",
|
|
68
|
+
"@ocap/types": "1.30.26",
|
|
69
|
+
"@ocap/util": "1.30.26",
|
|
68
70
|
"debug": "^4.4.3",
|
|
69
71
|
"better-sqlite3": "^11.8.1",
|
|
70
72
|
"kysely": "^0.28.14",
|