dirsql 0.3.96 → 0.3.97
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 +5 -6
- package/dist/dirsql.d.ts.map +1 -1
- package/dist/dirsql.js.map +1 -1
- package/docs/reference/cli.md +1 -1
- package/docs/reference/config.md +5 -6
- package/docs/reference/sdk.md +8 -8
- package/package.json +11 -11
package/dist/dirsql.d.ts
CHANGED
|
@@ -21,9 +21,8 @@ export interface ExtensionSpec {
|
|
|
21
21
|
/**
|
|
22
22
|
* Options accepted by the {@link DirSQL} constructor.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* file (a warning is emitted by the native layer).
|
|
24
|
+
* The index root is the explicit `root` when given, otherwise the process
|
|
25
|
+
* working directory. The `config` file's location never sets the root.
|
|
27
26
|
*/
|
|
28
27
|
export interface DirSQLOptions {
|
|
29
28
|
/** Root directory to scan. */
|
|
@@ -35,9 +34,9 @@ export interface DirSQLOptions {
|
|
|
35
34
|
/**
|
|
36
35
|
* Path to a `.dirsql.toml` config file. Its `[[table]]` entries are
|
|
37
36
|
* appended to any programmatic `tables`; its `[dirsql].ignore` patterns
|
|
38
|
-
* are appended to any explicit `ignore`.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* are appended to any explicit `ignore`. The config file's location does
|
|
38
|
+
* not affect the index root — that is the explicit `root` when given,
|
|
39
|
+
* otherwise the process working directory.
|
|
41
40
|
*/
|
|
42
41
|
config?: string;
|
|
43
42
|
/**
|
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,MA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;;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/dirsql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dirsql.js","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"dirsql.js","sourceRoot":"","sources":["../src/dirsql.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAiF9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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AG,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/docs/reference/cli.md
CHANGED
|
@@ -45,7 +45,7 @@ requests, closes open `/events` streams, and exits.
|
|
|
45
45
|
|
|
46
46
|
| Flag | Default | Description |
|
|
47
47
|
|---|---|---|
|
|
48
|
-
| `-c, --config <path>` | `./.dirsql.toml` | Path to the [config file](./config.md). The index is rooted at the directory
|
|
48
|
+
| `-c, --config <path>` | `./.dirsql.toml` | Path to the [config file](./config.md). The index is always rooted at the **invocation directory** (the current working directory), regardless of where this file lives — so `--config /elsewhere/.dirsql.toml` still indexes the directory you ran `dirsql` from. When the file does not exist, the server runs in [zero-config mode](#zero-config-mode). |
|
|
49
49
|
| `--host <addr>` | `localhost` | Bind address. |
|
|
50
50
|
| `--port <n>` | `7117` | TCP port to bind. |
|
|
51
51
|
| `--persist [<path>]` | off | Keep the SQLite index on disk between runs so a restart only re-parses files that actually changed. Bare `--persist` caches at `<root>/.dirsql/cache.db`; `--persist <path>` caches at `<path>`. Off by default (the index is ephemeral). Global — also honored by [`dirsql query`](#dirsql-query). See [Keep the index across restarts](../howto/persist.md). |
|
package/docs/reference/config.md
CHANGED
|
@@ -11,16 +11,16 @@ The [CLI](./cli.md) loads `./.dirsql.toml` by default (`--config <path>`
|
|
|
11
11
|
overrides). The [SDKs](./sdk.md) load a config via the `config` constructor
|
|
12
12
|
parameter.
|
|
13
13
|
|
|
14
|
-
**Path resolution.** Relative paths in the config (`
|
|
15
|
-
`
|
|
16
|
-
directory. The
|
|
17
|
-
|
|
14
|
+
**Path resolution.** Relative paths in the config (`[[dirsql.extension]]`
|
|
15
|
+
`path`) resolve against the config file's parent
|
|
16
|
+
directory. The **index root is not a config concern** — it is decided by the
|
|
17
|
+
runner (the CLI's invocation directory, or an SDK's explicit root), never by
|
|
18
|
+
the config file's location. See [`--config`](./cli.md#flags).
|
|
18
19
|
|
|
19
20
|
## `[dirsql]` keys
|
|
20
21
|
|
|
21
22
|
| Key | Type | Default | Description |
|
|
22
23
|
|---|---|---|---|
|
|
23
|
-
| `root` | string | config file's parent directory | Directory to index. Relative values resolve against the config file's parent. An explicit `root` passed to an SDK constructor overrides this (a warning is emitted on stderr). |
|
|
24
24
|
| `ignore` | array of strings | `[]` | Glob patterns matched against root-relative paths. Matched files are skipped entirely — excluded from the initial scan and from watch events. |
|
|
25
25
|
| `pre-query` | string | none | Server-wide command hook: the raw `POST /query` request body is passed to this command as `{args}`, and the plain-text SQL it prints is executed instead of parsing the body as `{"sql": …}`. CLI server only; the SDKs ignore it. Must be non-empty. See [Command hooks](./hooks.md#pre-query). |
|
|
26
26
|
| `post-query` | string | none | Server-wide command hook: each successful `POST /query` result set is handed to this command (as a JSON array on stdin, and as `{args}` up to 96 KiB), and the JSON body it prints is returned instead of the bare row array. CLI server only; the SDKs ignore it. Must be non-empty. See [Command hooks](./hooks.md#post-query). |
|
|
@@ -34,7 +34,6 @@ directory.
|
|
|
34
34
|
|
|
35
35
|
```toml
|
|
36
36
|
[dirsql]
|
|
37
|
-
root = "../data"
|
|
38
37
|
ignore = ["node_modules/**", ".git/**"]
|
|
39
38
|
hook-timeout = 300
|
|
40
39
|
```
|
package/docs/reference/sdk.md
CHANGED
|
@@ -92,22 +92,22 @@ DirSQL::builder()
|
|
|
92
92
|
|
|
93
93
|
:::
|
|
94
94
|
|
|
95
|
-
Creates a SQLite index over a directory.
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
Creates a SQLite index over a directory. The index root is the explicit
|
|
96
|
+
`root` when given, else the **process cwd** — the `config` file's location
|
|
97
|
+
never sets the root.
|
|
98
98
|
|
|
99
99
|
**Parameters:**
|
|
100
100
|
|
|
101
|
-
- `root` — Directory to index.
|
|
101
|
+
- `root` — Directory to index. When omitted, the index roots at the process
|
|
102
|
+
cwd (even when `config` is supplied).
|
|
102
103
|
- `tables` — Programmatic [`Table`](#table) definitions.
|
|
103
104
|
- `ignore` — Glob patterns matched against root-relative paths; matched
|
|
104
105
|
files are skipped entirely (scan and watch).
|
|
105
106
|
- `config` — Path to a [`.dirsql.toml`](./config.md). Its `[[table]]`
|
|
106
107
|
entries are appended after any programmatic `tables`; its `ignore`
|
|
107
|
-
patterns and `[[dirsql.extension]]` entries are appended likewise
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
value wins and a warning is emitted on stderr.
|
|
108
|
+
patterns and `[[dirsql.extension]]` entries are appended likewise. The
|
|
109
|
+
config file does **not** set the index root: with no explicit `root`, the
|
|
110
|
+
index roots at the process cwd.
|
|
111
111
|
- `persist` — Keep the SQLite index on disk between runs (default off:
|
|
112
112
|
ephemeral, rebuilt every startup). The cache lives at
|
|
113
113
|
`<root>/.dirsql/cache.db` by default; on restart, only files whose stat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.97",
|
|
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.97",
|
|
216
|
+
"@dirsql/lib-linux-arm64-gnu": "0.3.97",
|
|
217
|
+
"@dirsql/lib-darwin-x64": "0.3.97",
|
|
218
|
+
"@dirsql/lib-darwin-arm64": "0.3.97",
|
|
219
|
+
"@dirsql/lib-win32-x64-msvc": "0.3.97",
|
|
220
|
+
"@dirsql/cli-linux-x64-gnu": "0.3.97",
|
|
221
|
+
"@dirsql/cli-linux-arm64-gnu": "0.3.97",
|
|
222
|
+
"@dirsql/cli-darwin-x64": "0.3.97",
|
|
223
|
+
"@dirsql/cli-darwin-arm64": "0.3.97",
|
|
224
|
+
"@dirsql/cli-win32-x64-msvc": "0.3.97"
|
|
225
225
|
}
|
|
226
226
|
}
|