dirsql 0.4.4 → 0.4.5

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/core.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import type { ExtensionSpec, RowEvent } from "./dirsql.js";
1
+ import type { ExtensionSpec, RowEvent, ScanFailure } from "./dirsql.js";
2
2
  import type { TableDef } from "./table.js";
3
3
  export interface NativeDirSQL {
4
4
  query(sql: string): Promise<Record<string, unknown>[]>;
5
5
  startWatcher(): Promise<void>;
6
6
  pollEvents(timeoutMs: number): Promise<RowEvent[]>;
7
+ scanFailures(): ScanFailure[];
7
8
  close(): void;
8
9
  }
9
10
  export interface NativeDirSQLConstructor {
package/dist/dirsql.d.ts CHANGED
@@ -75,6 +75,19 @@ export interface RowEvent {
75
75
  error?: string | null;
76
76
  filePath?: string | null;
77
77
  }
78
+ /**
79
+ * One file the initial scan could not index.
80
+ *
81
+ * A scan failure is not a scan *error*: the other files are indexed and the
82
+ * database is usable. This is how a caller learns the index is incomplete,
83
+ * and which files are missing from it.
84
+ */
85
+ export interface ScanFailure {
86
+ /** Path relative to the scan root. */
87
+ path: string;
88
+ /** The hook's error, as it rendered it. */
89
+ message: string;
90
+ }
78
91
  /**
79
92
  * Ephemeral SQL index over a local directory.
80
93
  *
@@ -128,6 +141,18 @@ export declare class DirSQL {
128
141
  * even for large result sets or long-running queries.
129
142
  */
130
143
  query(sql: string): Promise<Record<string, unknown>[]>;
144
+ /**
145
+ * The files the initial scan could not index, each with its root-relative
146
+ * `path` and the hook's own `message`.
147
+ *
148
+ * Empty after a clean scan, which is the signal to check: a non-empty list
149
+ * means the index is *incomplete*, not wrong, and those files are retried
150
+ * on the next scan.
151
+ *
152
+ * Awaits the initial scan first, so a caller cannot see an empty list
153
+ * merely because the scan had not yet reached the failing file.
154
+ */
155
+ scanFailures(): Promise<ScanFailure[]>;
131
156
  /**
132
157
  * Start the file watcher. Must be called before {@link pollEvents}.
133
158
  * Idempotent — safe to call multiple times.
package/dist/dirsql.js CHANGED
@@ -97,6 +97,21 @@ export class DirSQL {
97
97
  await this.ready;
98
98
  return this._inner.query(sql);
99
99
  }
100
+ /**
101
+ * The files the initial scan could not index, each with its root-relative
102
+ * `path` and the hook's own `message`.
103
+ *
104
+ * Empty after a clean scan, which is the signal to check: a non-empty list
105
+ * means the index is *incomplete*, not wrong, and those files are retried
106
+ * on the next scan.
107
+ *
108
+ * Awaits the initial scan first, so a caller cannot see an empty list
109
+ * merely because the scan had not yet reached the failing file.
110
+ */
111
+ async scanFailures() {
112
+ await this.ready;
113
+ return this._inner.scanFailures();
114
+ }
100
115
  /**
101
116
  * Start the file watcher. Must be called before {@link pollEvents}.
102
117
  * Idempotent — safe to call multiple times.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { DirSQL } from "./dirsql.js";
2
- export type { DirSQLOptions, ExtensionSpec, RowEvent, } from "./dirsql.js";
2
+ export type { DirSQLOptions, ExtensionSpec, RowEvent, ScanFailure, } from "./dirsql.js";
3
3
  export { parseTableName } from "./parse-table-name.js";
4
4
  export { Table } from "./table.js";
5
5
  export type { TableDef } from "./table.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Ephemeral SQL index over a local directory",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/thekevinscott/dirsql",
@@ -212,15 +212,15 @@
212
212
  ]
213
213
  },
214
214
  "optionalDependencies": {
215
- "@dirsql/lib-linux-x64-gnu": "0.4.4",
216
- "@dirsql/lib-linux-arm64-gnu": "0.4.4",
217
- "@dirsql/lib-darwin-x64": "0.4.4",
218
- "@dirsql/lib-darwin-arm64": "0.4.4",
219
- "@dirsql/lib-win32-x64-msvc": "0.4.4",
220
- "@dirsql/cli-linux-x64-gnu": "0.4.4",
221
- "@dirsql/cli-linux-arm64-gnu": "0.4.4",
222
- "@dirsql/cli-darwin-x64": "0.4.4",
223
- "@dirsql/cli-darwin-arm64": "0.4.4",
224
- "@dirsql/cli-win32-x64-msvc": "0.4.4"
215
+ "@dirsql/lib-linux-x64-gnu": "0.4.5",
216
+ "@dirsql/lib-linux-arm64-gnu": "0.4.5",
217
+ "@dirsql/lib-darwin-x64": "0.4.5",
218
+ "@dirsql/lib-darwin-arm64": "0.4.5",
219
+ "@dirsql/lib-win32-x64-msvc": "0.4.5",
220
+ "@dirsql/cli-linux-x64-gnu": "0.4.5",
221
+ "@dirsql/cli-linux-arm64-gnu": "0.4.5",
222
+ "@dirsql/cli-darwin-x64": "0.4.5",
223
+ "@dirsql/cli-darwin-arm64": "0.4.5",
224
+ "@dirsql/cli-win32-x64-msvc": "0.4.5"
225
225
  }
226
226
  }