dirsql 0.3.101 → 0.3.103
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/dirsql.d.ts +1 -1
- package/dist/dirsql.d.ts.map +1 -1
- package/dist/table.d.ts +3 -3
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +2 -2
- package/dist/table.js.map +1 -1
- package/docs/howto/embed.md +6 -6
- package/docs/howto/extract-from-contents.md +1 -1
- package/docs/index.md +3 -3
- package/docs/reference/columns.md +3 -3
- package/docs/reference/config.md +2 -2
- package/docs/reference/sdk.md +16 -10
- package/package.json +11 -11
package/dist/dirsql.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface ExtensionSpec {
|
|
|
27
27
|
export interface DirSQLOptions {
|
|
28
28
|
/** Root directory to scan. */
|
|
29
29
|
root?: string;
|
|
30
|
-
/** Programmatic table definitions. Each table's `
|
|
30
|
+
/** Programmatic table definitions. Each table's `onFile` runs in-process. */
|
|
31
31
|
tables?: TableDef[];
|
|
32
32
|
/** Glob patterns (relative to `root`) to ignore. */
|
|
33
33
|
ignore?: string[];
|
package/dist/dirsql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dirsql.d.ts","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"dirsql.d.ts","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,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;IACrB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,MAAM;IAIjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IAEvC;;;;;;OAMG;IACH,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAEzB;IAGD,OAAO,CAAC,MAAM,CAAgB;IAE9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IAEjC,wDAAwD;gBAC5C,UAAU,EAAE,MAAM;IAC9B,yCAAyC;gBAC7B,OAAO,EAAE,aAAa;IA6ClC;;;;;;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;;;;;;;;;;OAUG;IACI,KAAK,IAAI,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;CAYxD"}
|
package/dist/table.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ export interface TableDef {
|
|
|
10
10
|
* callback needs the file body it reads the path itself (e.g.
|
|
11
11
|
* `fs.readFileSync(filePath, "utf8")`). Returns an array of row objects.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
onFile: (filePath: string) => Record<string, unknown>[];
|
|
14
14
|
/** If true, reject rows with columns not declared in `ddl`. */
|
|
15
15
|
strict?: boolean;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Thin class wrapper around {@link TableDef} for parity with the Python
|
|
19
|
-
* `Table(ddl=..., glob=...,
|
|
19
|
+
* `Table(ddl=..., glob=..., on_file=...)` and Rust `Table::new(...)`
|
|
20
20
|
* constructors. `new Table({...})` is structurally identical to a plain
|
|
21
21
|
* object literal satisfying `TableDef` — anything accepting `TableDef[]`
|
|
22
22
|
* (e.g. {@link DirSQL}'s `tables` option) takes either form.
|
|
@@ -29,7 +29,7 @@ export interface TableDef {
|
|
|
29
29
|
export declare class Table implements TableDef {
|
|
30
30
|
readonly ddl: string;
|
|
31
31
|
readonly glob: string;
|
|
32
|
-
readonly
|
|
32
|
+
readonly onFile: (filePath: string) => Record<string, unknown>[];
|
|
33
33
|
readonly strict?: boolean;
|
|
34
34
|
constructor(def: TableDef);
|
|
35
35
|
}
|
package/dist/table.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACxD,+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,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzE,SAAiB,MAAM,CAAC,EAAE,OAAO,CAAC;gBAEtB,GAAG,EAAE,QAAQ;CAQ1B"}
|
package/dist/table.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// unit test instead of an exemption (#239).
|
|
5
5
|
/**
|
|
6
6
|
* Thin class wrapper around {@link TableDef} for parity with the Python
|
|
7
|
-
* `Table(ddl=..., glob=...,
|
|
7
|
+
* `Table(ddl=..., glob=..., on_file=...)` and Rust `Table::new(...)`
|
|
8
8
|
* constructors. `new Table({...})` is structurally identical to a plain
|
|
9
9
|
* object literal satisfying `TableDef` — anything accepting `TableDef[]`
|
|
10
10
|
* (e.g. {@link DirSQL}'s `tables` option) takes either form.
|
|
@@ -18,7 +18,7 @@ export class Table {
|
|
|
18
18
|
constructor(def) {
|
|
19
19
|
this.ddl = def.ddl;
|
|
20
20
|
this.glob = def.glob;
|
|
21
|
-
this.
|
|
21
|
+
this.onFile = def.onFile;
|
|
22
22
|
if (def.strict !== undefined) {
|
|
23
23
|
this.strict = def.strict;
|
|
24
24
|
}
|
package/dist/table.js.map
CHANGED
|
@@ -1 +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,
|
|
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,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACzB,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC3B,CAAC;IACH,CAAC;CACF"}
|
package/docs/howto/embed.md
CHANGED
|
@@ -33,7 +33,7 @@ comments/t1/c2.json # {"body": "nice post", "author": "bob"}
|
|
|
33
33
|
comments/t2/c1.json # {"body": "following up", "author": "alice"}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Unlike a config-file table, a programmatic table takes an `
|
|
36
|
+
Unlike a config-file table, a programmatic table takes an `on_file`
|
|
37
37
|
callback — your code reads each matched file and returns its rows, with
|
|
38
38
|
[glob captures and stat columns](../reference/columns.md) merged on
|
|
39
39
|
automatically (here, `{thread}` from the path):
|
|
@@ -47,7 +47,7 @@ import json
|
|
|
47
47
|
from dirsql import DirSQL, Table
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def
|
|
50
|
+
def on_file(path: str) -> list[dict]:
|
|
51
51
|
with open(path, encoding="utf-8") as f:
|
|
52
52
|
return [json.load(f)]
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ async def main() -> None:
|
|
|
59
59
|
Table(
|
|
60
60
|
ddl="CREATE TABLE comments (thread TEXT, author TEXT, body TEXT)",
|
|
61
61
|
glob="comments/{thread}/*.json",
|
|
62
|
-
|
|
62
|
+
on_file=on_file,
|
|
63
63
|
)
|
|
64
64
|
],
|
|
65
65
|
)
|
|
@@ -81,7 +81,7 @@ const db = new DirSQL({
|
|
|
81
81
|
{
|
|
82
82
|
ddl: "CREATE TABLE comments (thread TEXT, author TEXT, body TEXT)",
|
|
83
83
|
glob: "comments/{thread}/*.json",
|
|
84
|
-
|
|
84
|
+
onFile: (path) => [JSON.parse(readFileSync(path, "utf8"))],
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
87
|
});
|
|
@@ -99,7 +99,7 @@ use std::collections::HashMap;
|
|
|
99
99
|
|
|
100
100
|
use dirsql::{DirSQL, Table, Value};
|
|
101
101
|
|
|
102
|
-
fn
|
|
102
|
+
fn on_file(path: &str) -> Vec<HashMap<String, Value>> {
|
|
103
103
|
let raw = std::fs::read_to_string(path).unwrap_or_default();
|
|
104
104
|
let Ok(serde_json::Value::Object(obj)) = serde_json::from_str(&raw) else {
|
|
105
105
|
return vec![];
|
|
@@ -119,7 +119,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
119
119
|
.table(Table::new(
|
|
120
120
|
"CREATE TABLE comments (thread TEXT, author TEXT, body TEXT)",
|
|
121
121
|
"comments/{thread}/*.json",
|
|
122
|
-
|
|
122
|
+
on_file,
|
|
123
123
|
))
|
|
124
124
|
.build()?;
|
|
125
125
|
|
|
@@ -79,6 +79,6 @@ SQLite value mapping is under
|
|
|
79
79
|
file. If it is expensive, [keep the index across restarts](./persist.md).
|
|
80
80
|
- The flagship use of `on-file` — computing embeddings — is
|
|
81
81
|
[Search documents by meaning](./search-by-meaning.md).
|
|
82
|
-
- Embedding `dirsql` in a program instead? The SDK's `
|
|
82
|
+
- Embedding `dirsql` in a program instead? The SDK's `on_file` callback
|
|
83
83
|
fills the same role in-process — see
|
|
84
84
|
[Embed `dirsql` in your application](./embed.md).
|
package/docs/index.md
CHANGED
|
@@ -20,7 +20,7 @@ But querying across many files is slow.
|
|
|
20
20
|
|
|
21
21
|
## Solution
|
|
22
22
|
|
|
23
|
-
`dirsql` bridges this gap. The filesystem remains the source of truth, but you get SQL queries and real-time change events for free. Define tables with glob patterns and
|
|
23
|
+
`dirsql` bridges this gap. The filesystem remains the source of truth, but you get SQL queries and real-time change events for free. Define tables with glob patterns and on-file callbacks, and `dirsql` handles the rest.
|
|
24
24
|
|
|
25
25
|
::: code-group
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ db = DirSQL(
|
|
|
34
34
|
Table(
|
|
35
35
|
ddl="CREATE TABLE files (name TEXT, size INTEGER, type TEXT)",
|
|
36
36
|
glob="data/*.json",
|
|
37
|
-
|
|
37
|
+
on_file=lambda path: [json.loads(open(path, encoding="utf-8").read())],
|
|
38
38
|
),
|
|
39
39
|
],
|
|
40
40
|
)
|
|
@@ -70,7 +70,7 @@ const db = new DirSQL({
|
|
|
70
70
|
new Table({
|
|
71
71
|
ddl: 'CREATE TABLE files (name TEXT, size INTEGER, type TEXT)',
|
|
72
72
|
glob: 'data/*.json',
|
|
73
|
-
|
|
73
|
+
onFile: (path) => [JSON.parse(readFileSync(path, 'utf8'))],
|
|
74
74
|
}),
|
|
75
75
|
],
|
|
76
76
|
});
|
|
@@ -18,7 +18,7 @@ Declaring them requires nothing else. The names below aren't a protected or
|
|
|
18
18
|
enforced namespace — nothing stops you from declaring a column with one of
|
|
19
19
|
these names for an unrelated purpose, in which case dirsql's computed value
|
|
20
20
|
lands there like any other fact (unless your own row source — an `on-file`
|
|
21
|
-
command or SDK `
|
|
21
|
+
command or SDK `on_file` callback — supplies its own value for that name;
|
|
22
22
|
see [Precedence](#precedence)).
|
|
23
23
|
|
|
24
24
|
## Stat columns
|
|
@@ -71,8 +71,8 @@ A file at `_comments/abc123/2024-05-05.jsonl` produces a row with
|
|
|
71
71
|
## Precedence
|
|
72
72
|
|
|
73
73
|
Values produced by a table's own row source — an `on-file` command's JSON
|
|
74
|
-
output or an SDK `
|
|
75
|
-
auto-injected facts of the same name. An
|
|
74
|
+
output or an SDK `on_file` callback's return value — **win** over
|
|
75
|
+
auto-injected facts of the same name. An `on_file` callback that explicitly emits
|
|
76
76
|
`path` is honored.
|
|
77
77
|
|
|
78
78
|
Injection order per row: stat columns first, then glob captures, then
|
package/docs/reference/config.md
CHANGED
|
@@ -98,13 +98,13 @@ per-file command.
|
|
|
98
98
|
|---|---|---|
|
|
99
99
|
| `ddl` | yes | A SQLite `CREATE TABLE` statement. The table name is parsed from it. Only columns declared here are populated; auto-injected facts not in the DDL are dropped. |
|
|
100
100
|
| `glob` | yes | Glob pattern matched against root-relative paths. May contain `{name}` [capture segments](./columns.md#glob-captures). Every table whose glob matches a file receives that file's rows — a file can populate multiple tables. |
|
|
101
|
-
| `strict` | no (default `false`) | When `true`, rows whose keys do not exactly match the declared columns are rejected with an error: extra keys error, and every declared column must be supplied (by the command/
|
|
101
|
+
| `strict` | no (default `false`) | When `true`, rows whose keys do not exactly match the declared columns are rejected with an error: extra keys error, and every declared column must be supplied (by the command/on-file output, a glob capture, or a stat column). When `false`, extra keys are dropped and missing columns become `NULL`. |
|
|
102
102
|
| `on-file` | no | A command run once per matched file; its stdout (a JSON array of row objects) becomes the file's rows. Must be non-empty. See [Command hooks](./hooks.md#on-file). |
|
|
103
103
|
|
|
104
104
|
Without `on-file`, a table produces exactly one row per matched file, built
|
|
105
105
|
entirely from filesystem facts. Content interpretation (frontmatter, JSON
|
|
106
106
|
fields, CSV parsing) is out of scope for plain config tables — use
|
|
107
|
-
`on-file`, or a programmatic [SDK table](./sdk.md#table) with an `
|
|
107
|
+
`on-file`, or a programmatic [SDK table](./sdk.md#table) with an `on_file`
|
|
108
108
|
callback.
|
|
109
109
|
|
|
110
110
|
```toml
|
package/docs/reference/sdk.md
CHANGED
|
@@ -80,7 +80,8 @@ DirSQL::builder()
|
|
|
80
80
|
.root(root) // optional
|
|
81
81
|
.tables(tables) // optional; append one with .table(t)
|
|
82
82
|
.ignore(patterns) // optional
|
|
83
|
-
.config(config_toml_path) // optional
|
|
83
|
+
.config(config_toml_path) // optional; repeatable — call again to
|
|
84
|
+
// merge another config in call order
|
|
84
85
|
.persist(cache_path) // optional; Some(path), or None for the
|
|
85
86
|
// default <root>/.dirsql/cache.db
|
|
86
87
|
.extensions(extensions) // optional; append one with .extension(e)
|
|
@@ -107,7 +108,12 @@ never sets the root.
|
|
|
107
108
|
entries are appended after any programmatic `tables`; its `ignore`
|
|
108
109
|
patterns and `[[dirsql.extension]]` entries are appended likewise. The
|
|
109
110
|
config file does **not** set the index root: with no explicit `root`, the
|
|
110
|
-
index roots at the process cwd.
|
|
111
|
+
index roots at the process cwd. In **Rust**, the builder's `.config()` is
|
|
112
|
+
**repeatable** — call it once per file and the configs merge in call order
|
|
113
|
+
(`[[table]]` / `ignore` / `[[dirsql.extension]]` accumulate; a duplicate
|
|
114
|
+
table name across configs errors), mirroring the CLI's repeatable
|
|
115
|
+
[`-c/--config`](./cli.md#flags). Python and TypeScript currently accept a
|
|
116
|
+
single `config` path.
|
|
111
117
|
- `persist` — Keep the SQLite index on disk between runs (default off:
|
|
112
118
|
ephemeral, rebuilt every startup). The cache lives at
|
|
113
119
|
`<root>/.dirsql/cache.db` by default; on restart, only files whose stat
|
|
@@ -296,19 +302,19 @@ rather than waiting — an intentional, language-idiomatic difference.
|
|
|
296
302
|
::: code-group
|
|
297
303
|
|
|
298
304
|
```python [Python]
|
|
299
|
-
Table(*, ddl: str, glob: str,
|
|
305
|
+
Table(*, ddl: str, glob: str, on_file: Callable[[str], list[dict]], strict: bool = False)
|
|
300
306
|
```
|
|
301
307
|
|
|
302
308
|
```typescript [TypeScript]
|
|
303
|
-
new Table({ ddl, glob,
|
|
309
|
+
new Table({ ddl, glob, onFile, strict? })
|
|
304
310
|
// or a plain object — TableDef and Table are interchangeable:
|
|
305
|
-
{ ddl: string, glob: string,
|
|
311
|
+
{ ddl: string, glob: string, onFile: (path: string) => Record<string, unknown>[], strict?: boolean }
|
|
306
312
|
```
|
|
307
313
|
|
|
308
314
|
```rust [Rust]
|
|
309
|
-
Table::new(ddl, glob,
|
|
310
|
-
Table::try_new(ddl, glob,
|
|
311
|
-
Table::strict(ddl, glob,
|
|
315
|
+
Table::new(ddl, glob, on_file) // on_file: Fn(&str) -> Vec<Row>, infallible
|
|
316
|
+
Table::try_new(ddl, glob, on_file) // on_file: Fn(&str) -> Result<Vec<Row>, _>
|
|
317
|
+
Table::strict(ddl, glob, on_file) // Table::new with strict = true
|
|
312
318
|
```
|
|
313
319
|
|
|
314
320
|
:::
|
|
@@ -321,7 +327,7 @@ Maps files to table rows.
|
|
|
321
327
|
`{name}` [captures](./columns.md#glob-captures). Every table whose glob
|
|
322
328
|
matches a file receives that file's rows — a file can populate multiple
|
|
323
329
|
tables.
|
|
324
|
-
- `
|
|
330
|
+
- `on_file` (`on_file` / `onFile`) — Callback receiving the matched file's full path (the root
|
|
325
331
|
joined with the file's relative path — absolute when `root` is absolute)
|
|
326
332
|
and returning the rows that file contributes. `dirsql` never reads file
|
|
327
333
|
contents itself; a callback that needs the body reads the path. Return
|
|
@@ -356,7 +362,7 @@ relative to the root. Errors never terminate the stream.
|
|
|
356
362
|
|
|
357
363
|
## Value types
|
|
358
364
|
|
|
359
|
-
An `
|
|
365
|
+
An `on_file` callback (and the SQLite columns it feeds) accepts:
|
|
360
366
|
|
|
361
367
|
| SQLite column | Python value | TypeScript value | Rust `Value` |
|
|
362
368
|
|---|---|---|---|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.103",
|
|
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.3.
|
|
216
|
-
"@dirsql/lib-linux-arm64-gnu": "0.3.
|
|
217
|
-
"@dirsql/lib-darwin-x64": "0.3.
|
|
218
|
-
"@dirsql/lib-darwin-arm64": "0.3.
|
|
219
|
-
"@dirsql/lib-win32-x64-msvc": "0.3.
|
|
220
|
-
"@dirsql/cli-linux-x64-gnu": "0.3.
|
|
221
|
-
"@dirsql/cli-linux-arm64-gnu": "0.3.
|
|
222
|
-
"@dirsql/cli-darwin-x64": "0.3.
|
|
223
|
-
"@dirsql/cli-darwin-arm64": "0.3.
|
|
224
|
-
"@dirsql/cli-win32-x64-msvc": "0.3.
|
|
215
|
+
"@dirsql/lib-linux-x64-gnu": "0.3.103",
|
|
216
|
+
"@dirsql/lib-linux-arm64-gnu": "0.3.103",
|
|
217
|
+
"@dirsql/lib-darwin-x64": "0.3.103",
|
|
218
|
+
"@dirsql/lib-darwin-arm64": "0.3.103",
|
|
219
|
+
"@dirsql/lib-win32-x64-msvc": "0.3.103",
|
|
220
|
+
"@dirsql/cli-linux-x64-gnu": "0.3.103",
|
|
221
|
+
"@dirsql/cli-linux-arm64-gnu": "0.3.103",
|
|
222
|
+
"@dirsql/cli-darwin-x64": "0.3.103",
|
|
223
|
+
"@dirsql/cli-darwin-arm64": "0.3.103",
|
|
224
|
+
"@dirsql/cli-win32-x64-msvc": "0.3.103"
|
|
225
225
|
}
|
|
226
226
|
}
|