dirsql 0.4.62 → 0.4.64
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/docs/getting-started.md
CHANGED
|
@@ -81,11 +81,15 @@ The first run downloads the package (`npx` asks for confirmation — answer
|
|
|
81
81
|
`y`; `uvx` prints download progress), then prints the result:
|
|
82
82
|
|
|
83
83
|
```
|
|
84
|
-
|
|
84
|
+
files
|
|
85
|
+
-----
|
|
86
|
+
3
|
|
87
|
+
|
|
88
|
+
1 row
|
|
85
89
|
```
|
|
86
90
|
|
|
87
91
|
Three files, three rows. That one command scanned the directory, handed
|
|
88
|
-
SQLite one row per file, ran your SQL, and printed the answer
|
|
92
|
+
SQLite one row per file, ran your SQL, and printed the answer.
|
|
89
93
|
|
|
90
94
|
There is no named table here — you never declared one. `'./'` is a
|
|
91
95
|
[path-table](./reference/path-tables.md): a quoted path written where a table
|
|
@@ -94,8 +98,9 @@ in. The path *is* the query.
|
|
|
94
98
|
|
|
95
99
|
## 3. Select some columns
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
At a terminal `dirsql` prints a table; when its output is piped, it prints a
|
|
102
|
+
JSON array of row objects instead. From here on we pipe it through `jq` to
|
|
103
|
+
pretty-print. Ask for two columns instead of a count:
|
|
99
104
|
|
|
100
105
|
::: code-group
|
|
101
106
|
|
|
@@ -60,11 +60,12 @@ its `embed()` SQL function),
|
|
|
60
60
|
and [`ignore`](../reference/config.md#dirsql-keys).
|
|
61
61
|
|
|
62
62
|
There are **no plugin-specific keys and no plugin-specific restrictions**. The
|
|
63
|
-
config schema is content-only: the index
|
|
64
|
-
[runner-owned
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
config schema is content-only: the index root and persistence are
|
|
64
|
+
[runner-owned](../reference/config.md#dirsql-keys) — the root is the directory
|
|
65
|
+
`dirsql` is run from (or an SDK's explicit `root`), persistence is the
|
|
66
|
+
`--persist [PATH]` flag — decided by whoever runs `dirsql`, never by a config
|
|
67
|
+
file, so a plugin has nothing to say about them. Whatever you can put in your
|
|
68
|
+
own `.dirsql.toml`, a plugin can put in its fragment, and vice-versa.
|
|
68
69
|
|
|
69
70
|
## Hook commands
|
|
70
71
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# CLI
|
|
2
2
|
|
|
3
|
-
Query is the default: `dirsql "<sql>"` runs one query and prints
|
|
3
|
+
Query is the default: `dirsql "<sql>"` runs one query and prints the rows —
|
|
4
|
+
a table at a terminal, a JSON array when piped (see
|
|
5
|
+
[Output format](#output-format)).
|
|
4
6
|
The `dirsql` binary has these modes:
|
|
5
7
|
|
|
6
8
|
| Invocation | Behavior |
|
|
7
9
|
|---|---|
|
|
8
|
-
| `dirsql "<sql>"` | Run one query over the directory and print the rows
|
|
10
|
+
| `dirsql "<sql>"` | Run one query over the directory and print the rows. The default; identical to `dirsql query "<sql>"`. |
|
|
9
11
|
| `dirsql query "<sql>"` | Explicit synonym for the default one-shot query. |
|
|
10
12
|
| `dirsql server` | Start a long-lived HTTP server exposing a SQL view of a directory. See [HTTP API](./http-api.md). |
|
|
11
13
|
| `dirsql init` | Generate a `.dirsql.toml`. |
|
|
@@ -53,7 +55,7 @@ pipeline, same flags, same output. See that section for config discovery,
|
|
|
53
55
|
|
|
54
56
|
```bash
|
|
55
57
|
dirsql
|
|
56
|
-
# dirsql
|
|
58
|
+
# dirsql <version> — this directory is a database.
|
|
57
59
|
#
|
|
58
60
|
# SELECT basename, size FROM './' ORDER BY size DESC LIMIT 5;
|
|
59
61
|
# SELECT path FROM './**/*.md' WHERE content LIKE '%TODO%';
|
|
@@ -331,9 +333,10 @@ is a hard error — `error: the subcommand 'query' cannot be used with
|
|
|
331
333
|
for the server they follow the subcommand: `dirsql server -c <cfg>`.)
|
|
332
334
|
:::
|
|
333
335
|
|
|
334
|
-
The subcommand builds the index, runs the SQL, prints the result rows
|
|
335
|
-
JSON array
|
|
336
|
-
|
|
336
|
+
The subcommand builds the index, runs the SQL, prints the result rows on
|
|
337
|
+
stdout — a table at a terminal, otherwise a JSON array byte-identical to the
|
|
338
|
+
[`POST /query`](./http-api.md) response body (see
|
|
339
|
+
[Output format](#output-format)) — and exits `0`.
|
|
337
340
|
|
|
338
341
|
`dirsql query` is a thin adapter over the **same query pipeline the server
|
|
339
342
|
uses**, so behavior is identical to `POST /query` by construction:
|
|
@@ -413,7 +416,7 @@ The output does **not** auto-load. Once you've tweaked it, pass it explicitly
|
|
|
413
416
|
to run against it:
|
|
414
417
|
|
|
415
418
|
```bash
|
|
416
|
-
dirsql "SELECT * FROM
|
|
419
|
+
dirsql "SELECT * FROM records" -c ./.dirsql.toml
|
|
417
420
|
```
|
|
418
421
|
|
|
419
422
|
### Flags
|
package/docs/reference/sdk.md
CHANGED
|
@@ -54,6 +54,7 @@ DirSQL(
|
|
|
54
54
|
*,
|
|
55
55
|
tables: list[Table] | None = None,
|
|
56
56
|
ignore: list[str] | None = None,
|
|
57
|
+
no_ignore: bool = False,
|
|
57
58
|
config: str | list[str] | None = None,
|
|
58
59
|
persist: bool = False,
|
|
59
60
|
persist_path: str | None = None,
|
|
@@ -68,6 +69,7 @@ new DirSQL({
|
|
|
68
69
|
root?: string,
|
|
69
70
|
tables?: TableDef[],
|
|
70
71
|
ignore?: string[],
|
|
72
|
+
noIgnore?: boolean,
|
|
71
73
|
config?: string | string[],
|
|
72
74
|
persist?: boolean,
|
|
73
75
|
persistPath?: string,
|
|
@@ -80,6 +82,7 @@ DirSQL::builder()
|
|
|
80
82
|
.root(root) // optional
|
|
81
83
|
.tables(tables) // optional; append one with .table(t)
|
|
82
84
|
.ignore(patterns) // optional
|
|
85
|
+
.no_ignore(true) // optional; default false
|
|
83
86
|
.config(config_toml_path) // optional; repeatable — call again to
|
|
84
87
|
// merge another config in call order
|
|
85
88
|
.persist(cache_path) // optional; Some(path), or None for the
|
|
@@ -115,6 +118,10 @@ shortcut was removed in #603 — use
|
|
|
115
118
|
- `tables` — Programmatic [`Table`](#table) definitions.
|
|
116
119
|
- `ignore` — Glob patterns matched against root-relative paths; matched
|
|
117
120
|
files are skipped entirely (scan and watch).
|
|
121
|
+
- `no_ignore` / `noIgnore` — Scan files a `.gitignore` would hide.
|
|
122
|
+
[Path-tables](./path-tables.md#skip-rules) respect `.gitignore` files by
|
|
123
|
+
default; the built-in `node_modules`/`.git` skips and any `ignore` patterns
|
|
124
|
+
still apply. The CLI's [`--no-ignore`](./cli.md#flags).
|
|
118
125
|
- `config` — Path to a [`.dirsql.toml`](./config.md). Its `[[table]]`
|
|
119
126
|
entries are appended after any programmatic `tables`; its `ignore`
|
|
120
127
|
patterns and `[[dirsql.extension]]` entries are appended likewise. The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.64",
|
|
4
4
|
"description": "Ephemeral SQL index over a local directory",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/thekevinscott/dirsql",
|
|
@@ -221,10 +221,10 @@
|
|
|
221
221
|
]
|
|
222
222
|
},
|
|
223
223
|
"optionalDependencies": {
|
|
224
|
-
"@dirsql/lib-linux-x64-gnu": "0.4.
|
|
225
|
-
"@dirsql/lib-linux-arm64-gnu": "0.4.
|
|
226
|
-
"@dirsql/lib-darwin-x64": "0.4.
|
|
227
|
-
"@dirsql/lib-darwin-arm64": "0.4.
|
|
228
|
-
"@dirsql/lib-win32-x64-msvc": "0.4.
|
|
224
|
+
"@dirsql/lib-linux-x64-gnu": "0.4.64",
|
|
225
|
+
"@dirsql/lib-linux-arm64-gnu": "0.4.64",
|
|
226
|
+
"@dirsql/lib-darwin-x64": "0.4.64",
|
|
227
|
+
"@dirsql/lib-darwin-arm64": "0.4.64",
|
|
228
|
+
"@dirsql/lib-win32-x64-msvc": "0.4.64"
|
|
229
229
|
}
|
|
230
230
|
}
|