dirsql 0.3.41 → 0.3.43
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/dist/cli/dirsql.js +4 -7
- package/dist/cli/dirsql.js.map +1 -1
- package/dist/cli/run-cli.d.ts +2 -0
- package/dist/cli/run-cli.d.ts.map +1 -0
- package/dist/cli/run-cli.js +12 -0
- package/dist/cli/run-cli.js.map +1 -0
- package/dist/core.d.ts +16 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +18 -0
- package/dist/core.js.map +1 -0
- package/dist/dirsql.d.ts +167 -0
- package/dist/dirsql.d.ts.map +1 -0
- package/dist/dirsql.js +129 -0
- package/dist/dirsql.js.map +1 -0
- package/dist/index.d.ts +5 -230
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -176
- package/dist/index.js.map +1 -1
- package/dist/parse-table-name.d.ts +9 -0
- package/dist/parse-table-name.d.ts.map +1 -0
- package/dist/parse-table-name.js +16 -0
- package/dist/parse-table-name.js.map +1 -0
- package/dist/table.d.ts +36 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +27 -0
- package/dist/table.js.map +1 -0
- package/docs/guide/tables.md +1 -1
- package/package.json +11 -11
package/dist/cli/dirsql.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// npm `bin` entry for `dirsql`. The package.json `bin` field points at
|
|
3
3
|
// the compiled version of this file; npm symlinks `node_modules/.bin/dirsql`
|
|
4
|
-
// to it.
|
|
5
|
-
//
|
|
4
|
+
// to it. All it does is invoke `runCli()` (see `run-cli.ts`); the launcher
|
|
5
|
+
// logic and its error handling live there so they can be unit-tested.
|
|
6
6
|
//
|
|
7
7
|
// A prior `process.argv[1] === import.meta.filename` self-detection
|
|
8
8
|
// guard tripped up the npm-bin symlink: argv[1] is the (unresolved)
|
|
9
9
|
// symlink path, while import.meta.filename is the realpath, and the
|
|
10
10
|
// guard silently skipped main() so `dirsql --version` produced no
|
|
11
11
|
// output (caught by the pack-install build-CI smoke test).
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
process.stderr.write(`dirsql: ${e instanceof Error ? e.message : String(e)}\n`);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
});
|
|
12
|
+
import { runCli } from "./run-cli.js";
|
|
13
|
+
runCli();
|
|
17
14
|
//# sourceMappingURL=dirsql.js.map
|
package/dist/cli/dirsql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dirsql.js","sourceRoot":"","sources":["../../src/cli/dirsql.ts"],"names":[],"mappings":";AACA,uEAAuE;AACvE,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"dirsql.js","sourceRoot":"","sources":["../../src/cli/dirsql.ts"],"names":[],"mappings":";AACA,uEAAuE;AACvE,6EAA6E;AAC7E,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,oEAAoE;AACpE,oEAAoE;AACpE,oEAAoE;AACpE,kEAAkE;AAClE,2DAA2D;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"AAOA,wBAAgB,MAAM,IAAI,IAAI,CAO7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The npm `bin` launcher's actual logic: run `main()` and translate a
|
|
2
|
+
// rejection into a stderr message + non-zero exit. Split out of the
|
|
3
|
+
// `dirsql.ts` entry shim so it carries a colocated unit test instead of
|
|
4
|
+
// an exemption (#239).
|
|
5
|
+
import { main } from "./main.js";
|
|
6
|
+
export function runCli() {
|
|
7
|
+
main().catch((e) => {
|
|
8
|
+
process.stderr.write(`dirsql: ${e instanceof Error ? e.message : String(e)}\n`);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=run-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cli.js","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,oEAAoE;AACpE,wEAAwE;AACxE,uBAAuB;AAEvB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,MAAM;IACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAC1D,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RowEvent } from "./dirsql.js";
|
|
2
|
+
import type { TableDef } from "./table.js";
|
|
3
|
+
export interface NativeDirSQL {
|
|
4
|
+
query(sql: string): Promise<Record<string, unknown>[]>;
|
|
5
|
+
startWatcher(): Promise<void>;
|
|
6
|
+
pollEvents(timeoutMs: number): Promise<RowEvent[]>;
|
|
7
|
+
}
|
|
8
|
+
export interface NativeDirSQLConstructor {
|
|
9
|
+
openAsync(root: string | null, tables: TableDef[] | null, ignore: string[] | null, config: string | null, persist: boolean | null, persistPath: string | null): Promise<NativeDirSQL>;
|
|
10
|
+
}
|
|
11
|
+
export interface CoreModule {
|
|
12
|
+
DirSQL: NativeDirSQLConstructor;
|
|
13
|
+
parseTableName(ddl: string): string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function getCore(): CoreModule;
|
|
16
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACvD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,CACP,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EACzB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1B;AAID,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,uBAAuB,CAAC;IAChC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC5C;AAQD,wBAAgB,OAAO,IAAI,UAAU,CAKpC"}
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Lazy access to the napi-rs core module, plus the test-only seam used to
|
|
2
|
+
// swap in a fake binding without loading the real native binary.
|
|
3
|
+
//
|
|
4
|
+
// Split out of the public barrel (`index.ts`) so it carries a colocated
|
|
5
|
+
// unit test instead of an exemption (#239).
|
|
6
|
+
import { loadNativeCore as defaultLoadNativeCore } from "./load-native-core.js";
|
|
7
|
+
// Lazy-loaded reference to the core module. Populated on first access by
|
|
8
|
+
// `defaultLoadNativeCore()`. Unit tests don't reach this state: they
|
|
9
|
+
// `vi.mock("./core.js")` to fake `getCore` directly, so production carries
|
|
10
|
+
// no test-only injection seam.
|
|
11
|
+
let core = null;
|
|
12
|
+
export function getCore() {
|
|
13
|
+
if (core === null) {
|
|
14
|
+
core = defaultLoadNativeCore();
|
|
15
|
+
}
|
|
16
|
+
return core;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,4CAA4C;AAG5C,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AA4BhF,yEAAyE;AACzE,qEAAqE;AACrE,2EAA2E;AAC3E,+BAA+B;AAC/B,IAAI,IAAI,GAAsB,IAAI,CAAC;AAEnC,MAAM,UAAU,OAAO;IACrB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,IAAI,GAAG,qBAAqB,EAAgB,CAAC;IAC/C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/dirsql.d.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { TableDef } from "./table.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options accepted by the {@link DirSQL} constructor.
|
|
4
|
+
*
|
|
5
|
+
* At least one of `root` or `config` must be supplied. When both are set,
|
|
6
|
+
* the explicit `root` wins over any `[dirsql].root` declared in the config
|
|
7
|
+
* file (a warning is emitted by the native layer).
|
|
8
|
+
*/
|
|
9
|
+
export interface DirSQLOptions {
|
|
10
|
+
/** Root directory to scan. */
|
|
11
|
+
root?: string;
|
|
12
|
+
/** Programmatic table definitions. Each table's `extract` runs in-process. */
|
|
13
|
+
tables?: TableDef[];
|
|
14
|
+
/** Glob patterns (relative to `root`) to ignore. */
|
|
15
|
+
ignore?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Path to a `.dirsql.toml` config file. Its `[[table]]` entries are
|
|
18
|
+
* appended to any programmatic `tables`; its `[dirsql].ignore` patterns
|
|
19
|
+
* are appended to any explicit `ignore`. If the config declares a
|
|
20
|
+
* `[dirsql].root` and no explicit `root` is given, it is resolved
|
|
21
|
+
* relative to the config file's parent directory.
|
|
22
|
+
*/
|
|
23
|
+
config?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Enable persistent on-disk SQLite cache. When `true`, the database is
|
|
26
|
+
* written to `<root>/.dirsql/cache.db` (override via `persistPath`) so
|
|
27
|
+
* subsequent startups only re-parse files that have actually changed.
|
|
28
|
+
*/
|
|
29
|
+
persist?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Override the location of the persistent cache file. Ignored when
|
|
32
|
+
* `persist` is not `true`.
|
|
33
|
+
*/
|
|
34
|
+
persistPath?: string;
|
|
35
|
+
}
|
|
36
|
+
/** A row-level event emitted by the file watcher. */
|
|
37
|
+
export interface RowEvent {
|
|
38
|
+
/**
|
|
39
|
+
* The table the event applies to. Always set for insert / update / delete.
|
|
40
|
+
* May be `null` on error events that occur before a file is attributed
|
|
41
|
+
* to any table (e.g. a watch-channel failure).
|
|
42
|
+
*/
|
|
43
|
+
table: string | null;
|
|
44
|
+
action: "insert" | "update" | "delete" | "error";
|
|
45
|
+
row?: Record<string, unknown> | null;
|
|
46
|
+
oldRow?: Record<string, unknown> | null;
|
|
47
|
+
error?: string | null;
|
|
48
|
+
filePath?: string | null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Serializable per-table portion of {@link DirSQLConfig}. Excludes the
|
|
52
|
+
* `extract` callback (closures aren't serializable) and the table's SQL
|
|
53
|
+
* `name` (derivable from `ddl`).
|
|
54
|
+
*/
|
|
55
|
+
export interface TableConfig {
|
|
56
|
+
ddl: string;
|
|
57
|
+
glob: string;
|
|
58
|
+
strict: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Serializable snapshot of a {@link DirSQL} instance's resolved runtime
|
|
62
|
+
* state, as produced by {@link DirSQL.toJSON} / `JSON.stringify(db)`.
|
|
63
|
+
*
|
|
64
|
+
* The shape is identical across the Python, Rust, and TypeScript SDKs
|
|
65
|
+
* (modulo `persist_path` ↔ `persistPath` case): the same payload can flow
|
|
66
|
+
* through the `interpret` handshake regardless of which SDK produced it.
|
|
67
|
+
*
|
|
68
|
+
* Construction artifacts that are no longer meaningful after the instance
|
|
69
|
+
* exists are intentionally excluded — `config` (already merged into `root`
|
|
70
|
+
* / `tables` / `ignore`), per-table `extract`, and per-table `name`.
|
|
71
|
+
*/
|
|
72
|
+
export interface DirSQLConfig {
|
|
73
|
+
root: string;
|
|
74
|
+
tables: TableConfig[];
|
|
75
|
+
ignore: string[];
|
|
76
|
+
persist: boolean;
|
|
77
|
+
persistPath: string | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Ephemeral SQL index over a local directory.
|
|
81
|
+
*
|
|
82
|
+
* The constructor is overloaded: pass a config-file path directly, or an
|
|
83
|
+
* options object with any combination of `root`, `tables`, `ignore`, and
|
|
84
|
+
* `config`.
|
|
85
|
+
*
|
|
86
|
+
* Constructing a `DirSQL` returns immediately; the directory scan, file
|
|
87
|
+
* reads, and initial row extraction run asynchronously. `db.ready`
|
|
88
|
+
* resolves once construction has completed, and every method (including
|
|
89
|
+
* {@link query}, {@link startWatcher}, {@link pollEvents}, and
|
|
90
|
+
* {@link watch}) transparently awaits `ready` before doing any work, so
|
|
91
|
+
* callers can start using the instance immediately:
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* // From a config file:
|
|
95
|
+
* const db = new DirSQL("./my-config.toml");
|
|
96
|
+
*
|
|
97
|
+
* // Programmatic:
|
|
98
|
+
* const db2 = new DirSQL({ root: "./data", tables: [...] });
|
|
99
|
+
*
|
|
100
|
+
* await db.ready; // optional: wait for the initial scan explicitly
|
|
101
|
+
* const rows = await db.query("SELECT ...");
|
|
102
|
+
* for await (const event of db.watch()) { ... }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* The scan runs on the libuv threadpool, so constructing a `DirSQL` does
|
|
106
|
+
* not block the JS event loop even for large directories.
|
|
107
|
+
*/
|
|
108
|
+
export declare class DirSQL {
|
|
109
|
+
/**
|
|
110
|
+
* Resolves once the initial directory scan + row extraction have
|
|
111
|
+
* completed, or rejects if construction failed. Every other method on
|
|
112
|
+
* this class implicitly awaits `ready`, so awaiting it explicitly is
|
|
113
|
+
* only necessary when a caller needs to observe construction errors
|
|
114
|
+
* synchronously (without issuing a query first).
|
|
115
|
+
*/
|
|
116
|
+
readonly ready: Promise<void>;
|
|
117
|
+
private _inner;
|
|
118
|
+
readonly _options: DirSQLOptions;
|
|
119
|
+
/** Construct from a `.dirsql.toml` config-file path. */
|
|
120
|
+
constructor(configPath: string);
|
|
121
|
+
/** Construct from structured options. */
|
|
122
|
+
constructor(options: DirSQLOptions);
|
|
123
|
+
/**
|
|
124
|
+
* Execute a SQL query and return results as an array of row objects.
|
|
125
|
+
*
|
|
126
|
+
* Awaits the initial scan if it has not yet finished, then runs the
|
|
127
|
+
* query on the libuv threadpool, so the JS event loop stays responsive
|
|
128
|
+
* even for large result sets or long-running queries.
|
|
129
|
+
*/
|
|
130
|
+
query(sql: string): Promise<Record<string, unknown>[]>;
|
|
131
|
+
/**
|
|
132
|
+
* Start the file watcher. Must be called before {@link pollEvents}.
|
|
133
|
+
* Idempotent — safe to call multiple times.
|
|
134
|
+
*
|
|
135
|
+
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
136
|
+
* libuv threadpool so the JS event loop stays responsive while the
|
|
137
|
+
* watcher is being initialized.
|
|
138
|
+
*/
|
|
139
|
+
startWatcher(): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Poll for file change events, blocking up to `timeoutMs` for the first
|
|
142
|
+
* event. Returns all events observed in the window (possibly empty).
|
|
143
|
+
*
|
|
144
|
+
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
145
|
+
* libuv threadpool so the JS event loop stays responsive for the
|
|
146
|
+
* duration of the poll timeout.
|
|
147
|
+
*/
|
|
148
|
+
pollEvents(timeoutMs: number): Promise<RowEvent[]>;
|
|
149
|
+
/**
|
|
150
|
+
* Resolved construction state. Recomputed on each call; reads the
|
|
151
|
+
* `.dirsql.toml` if `config` was supplied. Works before `ready`.
|
|
152
|
+
*/
|
|
153
|
+
toJSON(): DirSQLConfig;
|
|
154
|
+
/**
|
|
155
|
+
* Watch for file change events as an async iterable.
|
|
156
|
+
*
|
|
157
|
+
* ```ts
|
|
158
|
+
* for await (const event of db.watch()) { ... }
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* Awaits the initial scan on first iteration, starts the underlying
|
|
162
|
+
* watcher, then awaits a bounded native poll each cycle. The iterator
|
|
163
|
+
* runs indefinitely; break out of the `for await` loop to stop.
|
|
164
|
+
*/
|
|
165
|
+
watch(): AsyncGenerator<RowEvent, void, unknown>;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=dirsql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirsql.d.ts","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,MAAM;IACjB;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAG9B,OAAO,CAAC,MAAM,CAAgB;IAK9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IAEjC,wDAAwD;gBAC5C,UAAU,EAAE,MAAM;IAC9B,yCAAyC;gBAC7B,OAAO,EAAE,aAAa;IAmBlC;;;;;;OAMG;IACG,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAK5D;;;;;;;OAOG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC;;;;;;;OAOG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAKxD;;;OAGG;IACH,MAAM,IAAI,YAAY;IAItB;;;;;;;;;;OAUG;IACI,KAAK,IAAI,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;CAaxD"}
|
package/dist/dirsql.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// The `DirSQL` facade — the SDK's primary entry point.
|
|
2
|
+
//
|
|
3
|
+
// Split out of the public barrel (`index.ts`) so it carries a colocated
|
|
4
|
+
// unit test instead of an exemption (#239). The native binding is reached
|
|
5
|
+
// through `getCore()` (see `core.ts`), which tests fake.
|
|
6
|
+
import { getCore } from "./core.js";
|
|
7
|
+
import { resolveConfig } from "./resolve-config.js";
|
|
8
|
+
/**
|
|
9
|
+
* Ephemeral SQL index over a local directory.
|
|
10
|
+
*
|
|
11
|
+
* The constructor is overloaded: pass a config-file path directly, or an
|
|
12
|
+
* options object with any combination of `root`, `tables`, `ignore`, and
|
|
13
|
+
* `config`.
|
|
14
|
+
*
|
|
15
|
+
* Constructing a `DirSQL` returns immediately; the directory scan, file
|
|
16
|
+
* reads, and initial row extraction run asynchronously. `db.ready`
|
|
17
|
+
* resolves once construction has completed, and every method (including
|
|
18
|
+
* {@link query}, {@link startWatcher}, {@link pollEvents}, and
|
|
19
|
+
* {@link watch}) transparently awaits `ready` before doing any work, so
|
|
20
|
+
* callers can start using the instance immediately:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* // From a config file:
|
|
24
|
+
* const db = new DirSQL("./my-config.toml");
|
|
25
|
+
*
|
|
26
|
+
* // Programmatic:
|
|
27
|
+
* const db2 = new DirSQL({ root: "./data", tables: [...] });
|
|
28
|
+
*
|
|
29
|
+
* await db.ready; // optional: wait for the initial scan explicitly
|
|
30
|
+
* const rows = await db.query("SELECT ...");
|
|
31
|
+
* for await (const event of db.watch()) { ... }
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* The scan runs on the libuv threadpool, so constructing a `DirSQL` does
|
|
35
|
+
* not block the JS event loop even for large directories.
|
|
36
|
+
*/
|
|
37
|
+
export class DirSQL {
|
|
38
|
+
/**
|
|
39
|
+
* Resolves once the initial directory scan + row extraction have
|
|
40
|
+
* completed, or rejects if construction failed. Every other method on
|
|
41
|
+
* this class implicitly awaits `ready`, so awaiting it explicitly is
|
|
42
|
+
* only necessary when a caller needs to observe construction errors
|
|
43
|
+
* synchronously (without issuing a query first).
|
|
44
|
+
*/
|
|
45
|
+
ready;
|
|
46
|
+
// Initialized by `ready`. Do NOT touch before awaiting `ready`.
|
|
47
|
+
_inner;
|
|
48
|
+
// Constructor options preserved verbatim so `toJSON()` can resolve the
|
|
49
|
+
// serialized state synchronously without waiting for `ready`, and so
|
|
50
|
+
// `dirsql interpret` (#196) can reach the user-supplied `extract`
|
|
51
|
+
// callbacks (which `toJSON()` deliberately drops). Public-by-design.
|
|
52
|
+
_options;
|
|
53
|
+
constructor(arg) {
|
|
54
|
+
const options = typeof arg === "string" ? { config: arg } : arg;
|
|
55
|
+
this._options = options;
|
|
56
|
+
const Ctor = getCore().DirSQL;
|
|
57
|
+
const openPromise = Ctor.openAsync(options.root ?? null, options.tables ?? null, options.ignore ?? null, options.config ?? null, options.persist ?? null, options.persistPath ?? null);
|
|
58
|
+
this.ready = openPromise.then((inner) => {
|
|
59
|
+
this._inner = inner;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Execute a SQL query and return results as an array of row objects.
|
|
64
|
+
*
|
|
65
|
+
* Awaits the initial scan if it has not yet finished, then runs the
|
|
66
|
+
* query on the libuv threadpool, so the JS event loop stays responsive
|
|
67
|
+
* even for large result sets or long-running queries.
|
|
68
|
+
*/
|
|
69
|
+
async query(sql) {
|
|
70
|
+
await this.ready;
|
|
71
|
+
return this._inner.query(sql);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Start the file watcher. Must be called before {@link pollEvents}.
|
|
75
|
+
* Idempotent — safe to call multiple times.
|
|
76
|
+
*
|
|
77
|
+
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
78
|
+
* libuv threadpool so the JS event loop stays responsive while the
|
|
79
|
+
* watcher is being initialized.
|
|
80
|
+
*/
|
|
81
|
+
async startWatcher() {
|
|
82
|
+
await this.ready;
|
|
83
|
+
return this._inner.startWatcher();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Poll for file change events, blocking up to `timeoutMs` for the first
|
|
87
|
+
* event. Returns all events observed in the window (possibly empty).
|
|
88
|
+
*
|
|
89
|
+
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
90
|
+
* libuv threadpool so the JS event loop stays responsive for the
|
|
91
|
+
* duration of the poll timeout.
|
|
92
|
+
*/
|
|
93
|
+
async pollEvents(timeoutMs) {
|
|
94
|
+
await this.ready;
|
|
95
|
+
return this._inner.pollEvents(timeoutMs);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolved construction state. Recomputed on each call; reads the
|
|
99
|
+
* `.dirsql.toml` if `config` was supplied. Works before `ready`.
|
|
100
|
+
*/
|
|
101
|
+
toJSON() {
|
|
102
|
+
return resolveConfig(this._options);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Watch for file change events as an async iterable.
|
|
106
|
+
*
|
|
107
|
+
* ```ts
|
|
108
|
+
* for await (const event of db.watch()) { ... }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* Awaits the initial scan on first iteration, starts the underlying
|
|
112
|
+
* watcher, then awaits a bounded native poll each cycle. The iterator
|
|
113
|
+
* runs indefinitely; break out of the `for await` loop to stop.
|
|
114
|
+
*/
|
|
115
|
+
async *watch() {
|
|
116
|
+
await this.ready;
|
|
117
|
+
await this._inner.startWatcher();
|
|
118
|
+
while (true) {
|
|
119
|
+
// Native `pollEvents` now runs on the libuv threadpool and returns a
|
|
120
|
+
// Promise, so awaiting it does not park the JS thread. A ~200ms
|
|
121
|
+
// timeout keeps the poll cadence low without starving the event loop.
|
|
122
|
+
const events = await this._inner.pollEvents(200);
|
|
123
|
+
for (const event of events) {
|
|
124
|
+
yield event;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=dirsql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirsql.js","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,yDAAyD;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoFpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,MAAM;IACjB;;;;;;OAMG;IACM,KAAK,CAAgB;IAE9B,gEAAgE;IACxD,MAAM,CAAgB;IAC9B,uEAAuE;IACvE,qEAAqE;IACrE,kEAAkE;IAClE,qEAAqE;IAC5D,QAAQ,CAAgB;IAMjC,YAAY,GAA2B;QACrC,MAAM,OAAO,GACX,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAChC,OAAO,CAAC,IAAI,IAAI,IAAI,EACpB,OAAO,CAAC,MAAM,IAAI,IAAI,EACtB,OAAO,CAAC,MAAM,IAAI,IAAI,EACtB,OAAO,CAAC,MAAM,IAAI,IAAI,EACtB,OAAO,CAAC,OAAO,IAAI,IAAI,EACvB,OAAO,CAAC,WAAW,IAAI,IAAI,CAC5B,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CAAC,GAAW;QACrB,MAAM,IAAI,CAAC,KAAK,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,KAAK,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,SAAiB;QAChC,MAAM,IAAI,CAAC,KAAK,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,KAAK;QACV,MAAM,IAAI,CAAC,KAAK,CAAC;QACjB,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACjC,OAAO,IAAI,EAAE,CAAC;YACZ,qEAAqE;YACrE,gEAAgE;YAChE,sEAAsE;YACtE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACjD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,231 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
glob: string;
|
|
7
|
-
/**
|
|
8
|
-
* Produce the rows a matched file contributes. Receives the absolute
|
|
9
|
-
* filesystem path of the file. dirsql does not read file contents; if the
|
|
10
|
-
* callback needs the file body it reads the path itself (e.g.
|
|
11
|
-
* `fs.readFileSync(filePath, "utf8")`). Returns an array of row objects.
|
|
12
|
-
*/
|
|
13
|
-
extract: (filePath: string) => Record<string, unknown>[];
|
|
14
|
-
/** If true, reject rows with columns not declared in `ddl`. */
|
|
15
|
-
strict?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Thin class wrapper around {@link TableDef} for parity with the Python
|
|
19
|
-
* `Table(ddl=..., glob=..., extract=...)` and Rust `Table::new(...)`
|
|
20
|
-
* constructors. `new Table({...})` is structurally identical to a plain
|
|
21
|
-
* object literal satisfying `TableDef` — anything accepting `TableDef[]`
|
|
22
|
-
* (e.g. {@link DirSQL}'s `tables` option) takes either form.
|
|
23
|
-
*
|
|
24
|
-
* `strict` is only copied when present so the instance's enumerable keys
|
|
25
|
-
* match the input literal exactly; field declarations use `declare` to
|
|
26
|
-
* suppress the default class-field initializer that would otherwise pin
|
|
27
|
-
* `strict` to `undefined` under `useDefineForClassFields`.
|
|
28
|
-
*/
|
|
29
|
-
export declare class Table implements TableDef {
|
|
30
|
-
readonly ddl: string;
|
|
31
|
-
readonly glob: string;
|
|
32
|
-
readonly extract: (filePath: string) => Record<string, unknown>[];
|
|
33
|
-
readonly strict?: boolean;
|
|
34
|
-
constructor(def: TableDef);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Options accepted by the {@link DirSQL} constructor.
|
|
38
|
-
*
|
|
39
|
-
* At least one of `root` or `config` must be supplied. When both are set,
|
|
40
|
-
* the explicit `root` wins over any `[dirsql].root` declared in the config
|
|
41
|
-
* file (a warning is emitted by the native layer).
|
|
42
|
-
*/
|
|
43
|
-
export interface DirSQLOptions {
|
|
44
|
-
/** Root directory to scan. */
|
|
45
|
-
root?: string;
|
|
46
|
-
/** Programmatic table definitions. Each table's `extract` runs in-process. */
|
|
47
|
-
tables?: TableDef[];
|
|
48
|
-
/** Glob patterns (relative to `root`) to ignore. */
|
|
49
|
-
ignore?: string[];
|
|
50
|
-
/**
|
|
51
|
-
* Path to a `.dirsql.toml` config file. Its `[[table]]` entries are
|
|
52
|
-
* appended to any programmatic `tables`; its `[dirsql].ignore` patterns
|
|
53
|
-
* are appended to any explicit `ignore`. If the config declares a
|
|
54
|
-
* `[dirsql].root` and no explicit `root` is given, it is resolved
|
|
55
|
-
* relative to the config file's parent directory.
|
|
56
|
-
*/
|
|
57
|
-
config?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Enable persistent on-disk SQLite cache. When `true`, the database is
|
|
60
|
-
* written to `<root>/.dirsql/cache.db` (override via `persistPath`) so
|
|
61
|
-
* subsequent startups only re-parse files that have actually changed.
|
|
62
|
-
*/
|
|
63
|
-
persist?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Override the location of the persistent cache file. Ignored when
|
|
66
|
-
* `persist` is not `true`.
|
|
67
|
-
*/
|
|
68
|
-
persistPath?: string;
|
|
69
|
-
}
|
|
70
|
-
/** A row-level event emitted by the file watcher. */
|
|
71
|
-
export interface RowEvent {
|
|
72
|
-
/**
|
|
73
|
-
* The table the event applies to. Always set for insert / update / delete.
|
|
74
|
-
* May be `null` on error events that occur before a file is attributed
|
|
75
|
-
* to any table (e.g. a watch-channel failure).
|
|
76
|
-
*/
|
|
77
|
-
table: string | null;
|
|
78
|
-
action: "insert" | "update" | "delete" | "error";
|
|
79
|
-
row?: Record<string, unknown> | null;
|
|
80
|
-
oldRow?: Record<string, unknown> | null;
|
|
81
|
-
error?: string | null;
|
|
82
|
-
filePath?: string | null;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Serializable per-table portion of {@link DirSQLConfig}. Excludes the
|
|
86
|
-
* `extract` callback (closures aren't serializable) and the table's SQL
|
|
87
|
-
* `name` (derivable from `ddl`).
|
|
88
|
-
*/
|
|
89
|
-
export interface TableConfig {
|
|
90
|
-
ddl: string;
|
|
91
|
-
glob: string;
|
|
92
|
-
strict: boolean;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Serializable snapshot of a {@link DirSQL} instance's resolved runtime
|
|
96
|
-
* state, as produced by {@link DirSQL.toJSON} / `JSON.stringify(db)`.
|
|
97
|
-
*
|
|
98
|
-
* The shape is identical across the Python, Rust, and TypeScript SDKs
|
|
99
|
-
* (modulo `persist_path` ↔ `persistPath` case): the same payload can flow
|
|
100
|
-
* through the `interpret` handshake regardless of which SDK produced it.
|
|
101
|
-
*
|
|
102
|
-
* Construction artifacts that are no longer meaningful after the instance
|
|
103
|
-
* exists are intentionally excluded — `config` (already merged into `root`
|
|
104
|
-
* / `tables` / `ignore`), per-table `extract`, and per-table `name`.
|
|
105
|
-
*/
|
|
106
|
-
export interface DirSQLConfig {
|
|
107
|
-
root: string;
|
|
108
|
-
tables: TableConfig[];
|
|
109
|
-
ignore: string[];
|
|
110
|
-
persist: boolean;
|
|
111
|
-
persistPath: string | null;
|
|
112
|
-
}
|
|
113
|
-
interface NativeDirSQL {
|
|
114
|
-
query(sql: string): Promise<Record<string, unknown>[]>;
|
|
115
|
-
startWatcher(): Promise<void>;
|
|
116
|
-
pollEvents(timeoutMs: number): Promise<RowEvent[]>;
|
|
117
|
-
}
|
|
118
|
-
interface NativeDirSQLConstructor {
|
|
119
|
-
openAsync(root: string | null, tables: TableDef[] | null, ignore: string[] | null, config: string | null, persist: boolean | null, persistPath: string | null): Promise<NativeDirSQL>;
|
|
120
|
-
}
|
|
121
|
-
interface CoreModule {
|
|
122
|
-
DirSQL: NativeDirSQLConstructor;
|
|
123
|
-
parseTableName(ddl: string): string | null;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Parse the table name out of a `CREATE TABLE <name> (...)` DDL.
|
|
127
|
-
*
|
|
128
|
-
* Returns `null` for a DDL the parser doesn't recognize. Backed by the
|
|
129
|
-
* core Rust implementation (`dirsql::db::parse_table_name`) so the JS
|
|
130
|
-
* SDK and the orchestrator agree on table-name resolution.
|
|
131
|
-
*/
|
|
132
|
-
export declare function parseTableName(ddl: string): string | null;
|
|
133
|
-
/**
|
|
134
|
-
* **Test-only.** Replace the core module used by the SDK with a fake.
|
|
135
|
-
*
|
|
136
|
-
* This is an internal escape hatch for unit tests that want to mock the
|
|
137
|
-
* napi-rs binding layer without loading the real native binary. Passing
|
|
138
|
-
* `null` resets to the default (lazy native load on next access). Not
|
|
139
|
-
* part of the public API; do not use in application code.
|
|
140
|
-
*/
|
|
141
|
-
export declare function __setCoreForTesting(fake: CoreModule | null): void;
|
|
142
|
-
/**
|
|
143
|
-
* Ephemeral SQL index over a local directory.
|
|
144
|
-
*
|
|
145
|
-
* The constructor is overloaded: pass a config-file path directly, or an
|
|
146
|
-
* options object with any combination of `root`, `tables`, `ignore`, and
|
|
147
|
-
* `config`.
|
|
148
|
-
*
|
|
149
|
-
* Constructing a `DirSQL` returns immediately; the directory scan, file
|
|
150
|
-
* reads, and initial row extraction run asynchronously. `db.ready`
|
|
151
|
-
* resolves once construction has completed, and every method (including
|
|
152
|
-
* {@link query}, {@link startWatcher}, {@link pollEvents}, and
|
|
153
|
-
* {@link watch}) transparently awaits `ready` before doing any work, so
|
|
154
|
-
* callers can start using the instance immediately:
|
|
155
|
-
*
|
|
156
|
-
* ```ts
|
|
157
|
-
* // From a config file:
|
|
158
|
-
* const db = new DirSQL("./my-config.toml");
|
|
159
|
-
*
|
|
160
|
-
* // Programmatic:
|
|
161
|
-
* const db2 = new DirSQL({ root: "./data", tables: [...] });
|
|
162
|
-
*
|
|
163
|
-
* await db.ready; // optional: wait for the initial scan explicitly
|
|
164
|
-
* const rows = await db.query("SELECT ...");
|
|
165
|
-
* for await (const event of db.watch()) { ... }
|
|
166
|
-
* ```
|
|
167
|
-
*
|
|
168
|
-
* The scan runs on the libuv threadpool, so constructing a `DirSQL` does
|
|
169
|
-
* not block the JS event loop even for large directories.
|
|
170
|
-
*/
|
|
171
|
-
export declare class DirSQL {
|
|
172
|
-
/**
|
|
173
|
-
* Resolves once the initial directory scan + row extraction have
|
|
174
|
-
* completed, or rejects if construction failed. Every other method on
|
|
175
|
-
* this class implicitly awaits `ready`, so awaiting it explicitly is
|
|
176
|
-
* only necessary when a caller needs to observe construction errors
|
|
177
|
-
* synchronously (without issuing a query first).
|
|
178
|
-
*/
|
|
179
|
-
readonly ready: Promise<void>;
|
|
180
|
-
private _inner;
|
|
181
|
-
readonly _options: DirSQLOptions;
|
|
182
|
-
/** Construct from a `.dirsql.toml` config-file path. */
|
|
183
|
-
constructor(configPath: string);
|
|
184
|
-
/** Construct from structured options. */
|
|
185
|
-
constructor(options: DirSQLOptions);
|
|
186
|
-
/**
|
|
187
|
-
* Execute a SQL query and return results as an array of row objects.
|
|
188
|
-
*
|
|
189
|
-
* Awaits the initial scan if it has not yet finished, then runs the
|
|
190
|
-
* query on the libuv threadpool, so the JS event loop stays responsive
|
|
191
|
-
* even for large result sets or long-running queries.
|
|
192
|
-
*/
|
|
193
|
-
query(sql: string): Promise<Record<string, unknown>[]>;
|
|
194
|
-
/**
|
|
195
|
-
* Start the file watcher. Must be called before {@link pollEvents}.
|
|
196
|
-
* Idempotent — safe to call multiple times.
|
|
197
|
-
*
|
|
198
|
-
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
199
|
-
* libuv threadpool so the JS event loop stays responsive while the
|
|
200
|
-
* watcher is being initialized.
|
|
201
|
-
*/
|
|
202
|
-
startWatcher(): Promise<void>;
|
|
203
|
-
/**
|
|
204
|
-
* Poll for file change events, blocking up to `timeoutMs` for the first
|
|
205
|
-
* event. Returns all events observed in the window (possibly empty).
|
|
206
|
-
*
|
|
207
|
-
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
208
|
-
* libuv threadpool so the JS event loop stays responsive for the
|
|
209
|
-
* duration of the poll timeout.
|
|
210
|
-
*/
|
|
211
|
-
pollEvents(timeoutMs: number): Promise<RowEvent[]>;
|
|
212
|
-
/**
|
|
213
|
-
* Resolved construction state. Recomputed on each call; reads the
|
|
214
|
-
* `.dirsql.toml` if `config` was supplied. Works before `ready`.
|
|
215
|
-
*/
|
|
216
|
-
toJSON(): DirSQLConfig;
|
|
217
|
-
/**
|
|
218
|
-
* Watch for file change events as an async iterable.
|
|
219
|
-
*
|
|
220
|
-
* ```ts
|
|
221
|
-
* for await (const event of db.watch()) { ... }
|
|
222
|
-
* ```
|
|
223
|
-
*
|
|
224
|
-
* Awaits the initial scan on first iteration, starts the underlying
|
|
225
|
-
* watcher, then awaits a bounded native poll each cycle. The iterator
|
|
226
|
-
* runs indefinitely; break out of the `for await` loop to stop.
|
|
227
|
-
*/
|
|
228
|
-
watch(): AsyncGenerator<RowEvent, void, unknown>;
|
|
229
|
-
}
|
|
230
|
-
export {};
|
|
1
|
+
export { DirSQL } from "./dirsql.js";
|
|
2
|
+
export type { DirSQLConfig, DirSQLOptions, RowEvent, TableConfig, } from "./dirsql.js";
|
|
3
|
+
export { parseTableName } from "./parse-table-name.js";
|
|
4
|
+
export { Table } from "./table.js";
|
|
5
|
+
export type { TableDef } from "./table.js";
|
|
231
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EACV,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// dirsql TypeScript SDK.
|
|
1
|
+
// dirsql TypeScript SDK — public API barrel.
|
|
2
2
|
//
|
|
3
3
|
// The public surface is implemented in Rust via napi-rs. In development
|
|
4
4
|
// `pnpm build` runs `napi build` which drops `dirsql.node` at the
|
|
@@ -9,179 +9,12 @@
|
|
|
9
9
|
// `@dirsql/lib-<slug>` sub-package (wired via `optionalDependencies`),
|
|
10
10
|
// and the loader resolves the one matching the host's OS/arch. No Rust
|
|
11
11
|
// toolchain is required at install time on any supported platform.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* `strict` is only copied when present so the instance's enumerable keys
|
|
22
|
-
* match the input literal exactly; field declarations use `declare` to
|
|
23
|
-
* suppress the default class-field initializer that would otherwise pin
|
|
24
|
-
* `strict` to `undefined` under `useDefineForClassFields`.
|
|
25
|
-
*/
|
|
26
|
-
export class Table {
|
|
27
|
-
constructor(def) {
|
|
28
|
-
this.ddl = def.ddl;
|
|
29
|
-
this.glob = def.glob;
|
|
30
|
-
this.extract = def.extract;
|
|
31
|
-
if (def.strict !== undefined) {
|
|
32
|
-
this.strict = def.strict;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Parse the table name out of a `CREATE TABLE <name> (...)` DDL.
|
|
38
|
-
*
|
|
39
|
-
* Returns `null` for a DDL the parser doesn't recognize. Backed by the
|
|
40
|
-
* core Rust implementation (`dirsql::db::parse_table_name`) so the JS
|
|
41
|
-
* SDK and the orchestrator agree on table-name resolution.
|
|
42
|
-
*/
|
|
43
|
-
export function parseTableName(ddl) {
|
|
44
|
-
return getCore().parseTableName(ddl);
|
|
45
|
-
}
|
|
46
|
-
// Lazy-loaded reference to the core module. Populated on first access by
|
|
47
|
-
// `defaultLoadNativeCore()`, or by `__setCoreForTesting()` for tests.
|
|
48
|
-
let core = null;
|
|
49
|
-
function getCore() {
|
|
50
|
-
if (core === null) {
|
|
51
|
-
core = defaultLoadNativeCore();
|
|
52
|
-
}
|
|
53
|
-
return core;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* **Test-only.** Replace the core module used by the SDK with a fake.
|
|
57
|
-
*
|
|
58
|
-
* This is an internal escape hatch for unit tests that want to mock the
|
|
59
|
-
* napi-rs binding layer without loading the real native binary. Passing
|
|
60
|
-
* `null` resets to the default (lazy native load on next access). Not
|
|
61
|
-
* part of the public API; do not use in application code.
|
|
62
|
-
*/
|
|
63
|
-
export function __setCoreForTesting(fake) {
|
|
64
|
-
core = fake;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Ephemeral SQL index over a local directory.
|
|
68
|
-
*
|
|
69
|
-
* The constructor is overloaded: pass a config-file path directly, or an
|
|
70
|
-
* options object with any combination of `root`, `tables`, `ignore`, and
|
|
71
|
-
* `config`.
|
|
72
|
-
*
|
|
73
|
-
* Constructing a `DirSQL` returns immediately; the directory scan, file
|
|
74
|
-
* reads, and initial row extraction run asynchronously. `db.ready`
|
|
75
|
-
* resolves once construction has completed, and every method (including
|
|
76
|
-
* {@link query}, {@link startWatcher}, {@link pollEvents}, and
|
|
77
|
-
* {@link watch}) transparently awaits `ready` before doing any work, so
|
|
78
|
-
* callers can start using the instance immediately:
|
|
79
|
-
*
|
|
80
|
-
* ```ts
|
|
81
|
-
* // From a config file:
|
|
82
|
-
* const db = new DirSQL("./my-config.toml");
|
|
83
|
-
*
|
|
84
|
-
* // Programmatic:
|
|
85
|
-
* const db2 = new DirSQL({ root: "./data", tables: [...] });
|
|
86
|
-
*
|
|
87
|
-
* await db.ready; // optional: wait for the initial scan explicitly
|
|
88
|
-
* const rows = await db.query("SELECT ...");
|
|
89
|
-
* for await (const event of db.watch()) { ... }
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* The scan runs on the libuv threadpool, so constructing a `DirSQL` does
|
|
93
|
-
* not block the JS event loop even for large directories.
|
|
94
|
-
*/
|
|
95
|
-
export class DirSQL {
|
|
96
|
-
/**
|
|
97
|
-
* Resolves once the initial directory scan + row extraction have
|
|
98
|
-
* completed, or rejects if construction failed. Every other method on
|
|
99
|
-
* this class implicitly awaits `ready`, so awaiting it explicitly is
|
|
100
|
-
* only necessary when a caller needs to observe construction errors
|
|
101
|
-
* synchronously (without issuing a query first).
|
|
102
|
-
*/
|
|
103
|
-
ready;
|
|
104
|
-
// Initialized by `ready`. Do NOT touch before awaiting `ready`.
|
|
105
|
-
_inner;
|
|
106
|
-
// Constructor options preserved verbatim so `toJSON()` can resolve the
|
|
107
|
-
// serialized state synchronously without waiting for `ready`, and so
|
|
108
|
-
// `dirsql interpret` (#196) can reach the user-supplied `extract`
|
|
109
|
-
// callbacks (which `toJSON()` deliberately drops). Public-by-design.
|
|
110
|
-
_options;
|
|
111
|
-
constructor(arg) {
|
|
112
|
-
const options = typeof arg === "string" ? { config: arg } : arg;
|
|
113
|
-
this._options = options;
|
|
114
|
-
const Ctor = getCore().DirSQL;
|
|
115
|
-
const openPromise = Ctor.openAsync(options.root ?? null, options.tables ?? null, options.ignore ?? null, options.config ?? null, options.persist ?? null, options.persistPath ?? null);
|
|
116
|
-
this.ready = openPromise.then((inner) => {
|
|
117
|
-
this._inner = inner;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Execute a SQL query and return results as an array of row objects.
|
|
122
|
-
*
|
|
123
|
-
* Awaits the initial scan if it has not yet finished, then runs the
|
|
124
|
-
* query on the libuv threadpool, so the JS event loop stays responsive
|
|
125
|
-
* even for large result sets or long-running queries.
|
|
126
|
-
*/
|
|
127
|
-
async query(sql) {
|
|
128
|
-
await this.ready;
|
|
129
|
-
return this._inner.query(sql);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Start the file watcher. Must be called before {@link pollEvents}.
|
|
133
|
-
* Idempotent — safe to call multiple times.
|
|
134
|
-
*
|
|
135
|
-
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
136
|
-
* libuv threadpool so the JS event loop stays responsive while the
|
|
137
|
-
* watcher is being initialized.
|
|
138
|
-
*/
|
|
139
|
-
async startWatcher() {
|
|
140
|
-
await this.ready;
|
|
141
|
-
return this._inner.startWatcher();
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Poll for file change events, blocking up to `timeoutMs` for the first
|
|
145
|
-
* event. Returns all events observed in the window (possibly empty).
|
|
146
|
-
*
|
|
147
|
-
* Awaits the initial scan if it has not yet finished, then runs on the
|
|
148
|
-
* libuv threadpool so the JS event loop stays responsive for the
|
|
149
|
-
* duration of the poll timeout.
|
|
150
|
-
*/
|
|
151
|
-
async pollEvents(timeoutMs) {
|
|
152
|
-
await this.ready;
|
|
153
|
-
return this._inner.pollEvents(timeoutMs);
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Resolved construction state. Recomputed on each call; reads the
|
|
157
|
-
* `.dirsql.toml` if `config` was supplied. Works before `ready`.
|
|
158
|
-
*/
|
|
159
|
-
toJSON() {
|
|
160
|
-
return resolveConfig(this._options);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Watch for file change events as an async iterable.
|
|
164
|
-
*
|
|
165
|
-
* ```ts
|
|
166
|
-
* for await (const event of db.watch()) { ... }
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* Awaits the initial scan on first iteration, starts the underlying
|
|
170
|
-
* watcher, then awaits a bounded native poll each cycle. The iterator
|
|
171
|
-
* runs indefinitely; break out of the `for await` loop to stop.
|
|
172
|
-
*/
|
|
173
|
-
async *watch() {
|
|
174
|
-
await this.ready;
|
|
175
|
-
await this._inner.startWatcher();
|
|
176
|
-
while (true) {
|
|
177
|
-
// Native `pollEvents` now runs on the libuv threadpool and returns a
|
|
178
|
-
// Promise, so awaiting it does not park the JS thread. A ~200ms
|
|
179
|
-
// timeout keeps the poll cadence low without starving the event loop.
|
|
180
|
-
const events = await this._inner.pollEvents(200);
|
|
181
|
-
for (const event of events) {
|
|
182
|
-
yield event;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
12
|
+
//
|
|
13
|
+
// This file is a thin re-export barrel: the implementation lives in
|
|
14
|
+
// colocated-tested modules (`table.ts`, `core.ts`, `parse-table-name.ts`,
|
|
15
|
+
// `dirsql.ts`), each carrying its own unit test. The barrel itself is
|
|
16
|
+
// covered by `index.test.ts` (#239).
|
|
17
|
+
export { DirSQL } from "./dirsql.js";
|
|
18
|
+
export { parseTableName } from "./parse-table-name.js";
|
|
19
|
+
export { Table } from "./table.js";
|
|
187
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,kEAAkE;AAClE,uEAAuE;AACvE,qCAAqC;AACrC,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,mEAAmE;AACnE,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,sEAAsE;AACtE,qCAAqC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse the table name out of a `CREATE TABLE <name> (...)` DDL.
|
|
3
|
+
*
|
|
4
|
+
* Returns `null` for a DDL the parser doesn't recognize. Backed by the
|
|
5
|
+
* core Rust implementation (`dirsql::db::parse_table_name`) so the JS
|
|
6
|
+
* SDK and the orchestrator agree on table-name resolution.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseTableName(ddl: string): string | null;
|
|
9
|
+
//# sourceMappingURL=parse-table-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-table-name.d.ts","sourceRoot":"","sources":["../src/parse-table-name.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEzD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// `parseTableName` — table-name resolution delegated to the Rust core.
|
|
2
|
+
//
|
|
3
|
+
// Split out of the public barrel (`index.ts`) so it carries a colocated
|
|
4
|
+
// unit test instead of an exemption (#239).
|
|
5
|
+
import { getCore } from "./core.js";
|
|
6
|
+
/**
|
|
7
|
+
* Parse the table name out of a `CREATE TABLE <name> (...)` DDL.
|
|
8
|
+
*
|
|
9
|
+
* Returns `null` for a DDL the parser doesn't recognize. Backed by the
|
|
10
|
+
* core Rust implementation (`dirsql::db::parse_table_name`) so the JS
|
|
11
|
+
* SDK and the orchestrator agree on table-name resolution.
|
|
12
|
+
*/
|
|
13
|
+
export function parseTableName(ddl) {
|
|
14
|
+
return getCore().parseTableName(ddl);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=parse-table-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-table-name.js","sourceRoot":"","sources":["../src/parse-table-name.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,wEAAwE;AACxE,4CAA4C;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,OAAO,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
package/dist/table.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Definition of a SQL-indexed table backed by files on disk. */
|
|
2
|
+
export interface TableDef {
|
|
3
|
+
/** SQL DDL statement, e.g. `CREATE TABLE users (name TEXT, age INTEGER)`. */
|
|
4
|
+
ddl: string;
|
|
5
|
+
/** Glob pattern (relative to the DirSQL root) for files backing this table. */
|
|
6
|
+
glob: string;
|
|
7
|
+
/**
|
|
8
|
+
* Produce the rows a matched file contributes. Receives the absolute
|
|
9
|
+
* filesystem path of the file. dirsql does not read file contents; if the
|
|
10
|
+
* callback needs the file body it reads the path itself (e.g.
|
|
11
|
+
* `fs.readFileSync(filePath, "utf8")`). Returns an array of row objects.
|
|
12
|
+
*/
|
|
13
|
+
extract: (filePath: string) => Record<string, unknown>[];
|
|
14
|
+
/** If true, reject rows with columns not declared in `ddl`. */
|
|
15
|
+
strict?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Thin class wrapper around {@link TableDef} for parity with the Python
|
|
19
|
+
* `Table(ddl=..., glob=..., extract=...)` and Rust `Table::new(...)`
|
|
20
|
+
* constructors. `new Table({...})` is structurally identical to a plain
|
|
21
|
+
* object literal satisfying `TableDef` — anything accepting `TableDef[]`
|
|
22
|
+
* (e.g. {@link DirSQL}'s `tables` option) takes either form.
|
|
23
|
+
*
|
|
24
|
+
* `strict` is only copied when present so the instance's enumerable keys
|
|
25
|
+
* match the input literal exactly; field declarations use `declare` to
|
|
26
|
+
* suppress the default class-field initializer that would otherwise pin
|
|
27
|
+
* `strict` to `undefined` under `useDefineForClassFields`.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Table implements TableDef {
|
|
30
|
+
readonly ddl: string;
|
|
31
|
+
readonly glob: string;
|
|
32
|
+
readonly extract: (filePath: string) => Record<string, unknown>[];
|
|
33
|
+
readonly strict?: boolean;
|
|
34
|
+
constructor(def: TableDef);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"AAKA,iEAAiE;AACjE,MAAM,WAAW,QAAQ;IACvB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzD,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,YAAW,QAAQ;IACpC,SAAiB,GAAG,EAAE,MAAM,CAAC;IAC7B,SAAiB,IAAI,EAAE,MAAM,CAAC;IAC9B,SAAiB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAC1E,SAAiB,MAAM,CAAC,EAAE,OAAO,CAAC;gBAEtB,GAAG,EAAE,QAAQ;CAQ1B"}
|
package/dist/table.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// `Table` definition + its thin class wrapper.
|
|
2
|
+
//
|
|
3
|
+
// Split out of the public barrel (`index.ts`) so it carries a colocated
|
|
4
|
+
// unit test instead of an exemption (#239).
|
|
5
|
+
/**
|
|
6
|
+
* Thin class wrapper around {@link TableDef} for parity with the Python
|
|
7
|
+
* `Table(ddl=..., glob=..., extract=...)` and Rust `Table::new(...)`
|
|
8
|
+
* constructors. `new Table({...})` is structurally identical to a plain
|
|
9
|
+
* object literal satisfying `TableDef` — anything accepting `TableDef[]`
|
|
10
|
+
* (e.g. {@link DirSQL}'s `tables` option) takes either form.
|
|
11
|
+
*
|
|
12
|
+
* `strict` is only copied when present so the instance's enumerable keys
|
|
13
|
+
* match the input literal exactly; field declarations use `declare` to
|
|
14
|
+
* suppress the default class-field initializer that would otherwise pin
|
|
15
|
+
* `strict` to `undefined` under `useDefineForClassFields`.
|
|
16
|
+
*/
|
|
17
|
+
export class Table {
|
|
18
|
+
constructor(def) {
|
|
19
|
+
this.ddl = def.ddl;
|
|
20
|
+
this.glob = def.glob;
|
|
21
|
+
this.extract = def.extract;
|
|
22
|
+
if (def.strict !== undefined) {
|
|
23
|
+
this.strict = def.strict;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,wEAAwE;AACxE,4CAA4C;AAmB5C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,KAAK;IAMhB,YAAY,GAAa;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC3B,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC3B,CAAC;IACH,CAAC;CACF"}
|
package/docs/guide/tables.md
CHANGED
|
@@ -72,7 +72,7 @@ ddl="CREATE TABLE metrics (name TEXT, value REAL, count INTEGER)"
|
|
|
72
72
|
ddl="CREATE TABLE items (id TEXT PRIMARY KEY, name TEXT NOT NULL)"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
The table name is parsed from the DDL
|
|
75
|
+
The table name is parsed from the DDL and must resolve to a valid SQLite identifier.
|
|
76
76
|
|
|
77
77
|
### `glob`
|
|
78
78
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.43",
|
|
4
4
|
"description": "Ephemeral SQL index over a local directory",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/thekevinscott/dirsql",
|
|
@@ -219,15 +219,15 @@
|
|
|
219
219
|
"smol-toml": "^1.6.1"
|
|
220
220
|
},
|
|
221
221
|
"optionalDependencies": {
|
|
222
|
-
"@dirsql/lib-linux-x64-gnu": "0.3.
|
|
223
|
-
"@dirsql/lib-linux-arm64-gnu": "0.3.
|
|
224
|
-
"@dirsql/lib-darwin-x64": "0.3.
|
|
225
|
-
"@dirsql/lib-darwin-arm64": "0.3.
|
|
226
|
-
"@dirsql/lib-win32-x64-msvc": "0.3.
|
|
227
|
-
"@dirsql/cli-linux-x64-gnu": "0.3.
|
|
228
|
-
"@dirsql/cli-linux-arm64-gnu": "0.3.
|
|
229
|
-
"@dirsql/cli-darwin-x64": "0.3.
|
|
230
|
-
"@dirsql/cli-darwin-arm64": "0.3.
|
|
231
|
-
"@dirsql/cli-win32-x64-msvc": "0.3.
|
|
222
|
+
"@dirsql/lib-linux-x64-gnu": "0.3.43",
|
|
223
|
+
"@dirsql/lib-linux-arm64-gnu": "0.3.43",
|
|
224
|
+
"@dirsql/lib-darwin-x64": "0.3.43",
|
|
225
|
+
"@dirsql/lib-darwin-arm64": "0.3.43",
|
|
226
|
+
"@dirsql/lib-win32-x64-msvc": "0.3.43",
|
|
227
|
+
"@dirsql/cli-linux-x64-gnu": "0.3.43",
|
|
228
|
+
"@dirsql/cli-linux-arm64-gnu": "0.3.43",
|
|
229
|
+
"@dirsql/cli-darwin-x64": "0.3.43",
|
|
230
|
+
"@dirsql/cli-darwin-arm64": "0.3.43",
|
|
231
|
+
"@dirsql/cli-win32-x64-msvc": "0.3.43"
|
|
232
232
|
}
|
|
233
233
|
}
|