dirsql 0.4.101 → 0.4.102

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 CHANGED
@@ -43,7 +43,7 @@ export interface DirSQLOptions {
43
43
  config?: string | string[];
44
44
  /**
45
45
  * Enable persistent on-disk SQLite cache. When `true`, the database is
46
- * written to `<root>/.dirsql/cache.db` (override via `persistPath`) so
46
+ * written to the platform cache directory (override via `persistPath`) so
47
47
  * subsequent startups only re-parse files that have actually changed.
48
48
  */
49
49
  persist?: boolean;
@@ -17,9 +17,11 @@ why it is a CLI flag, not a config key.
17
17
  dirsql --persist
18
18
  ```
19
19
 
20
- That's the whole change. On the next run the cache is written to
21
- `.dirsql/cache.db` under the root; runs after that start from it. To put
22
- the cache elsewhere (a CI cache dir, a tmpfs), pass a path:
20
+ That's the whole change. On the next run the cache is written to your platform cache directory
21
+ (`$XDG_CACHE_HOME/dirsql/<root hash>/cache.db` on Linux, `~/Library/Caches`
22
+ on macOS, `%LOCALAPPDATA%` on Windows), outside the scanned tree; runs after
23
+ that start from it. To put the cache elsewhere (a CI cache dir, a tmpfs), pass
24
+ a path:
23
25
 
24
26
  ```bash
25
27
  dirsql --persist /var/cache/dirsql.db
@@ -30,20 +32,13 @@ put a bare `--persist` after the SQL there so it does not consume the query
30
32
  argument. Embedding `dirsql`? The SDK constructors expose the same switch —
31
33
  see [_Embedding `dirsql`?_](#embedding-dirsql) below.
32
34
 
33
- ## 2. Keep the cache out of git
35
+ ## 2. Nothing to ignore in git
34
36
 
35
- The cache is derived data — reproducible from the tree and frequently
36
- large. Add it to `.gitignore`:
37
-
38
- ```
39
- .dirsql/
40
- ```
41
-
42
- The top-level `.dirsql/` directory is reserved for `dirsql`'s metadata and
43
- is never scanned as data, so the cache can't index itself
44
- ([config reference](../reference/config.md#dirsql-keys)). While running,
45
- `dirsql` also creates transient `cache.db-wal` and `cache.db-shm` sidecar
46
- files next to the cache; the `.dirsql/` ignore already covers all three.
37
+ The default cache lives outside the scanned tree, so there is nothing to add
38
+ to `.gitignore` and the cache can't index itself. With `--persist <path>`, keep
39
+ that path out of the scanned tree too, or ignore it. While running, `dirsql`
40
+ also creates transient `cache.db-wal` and `cache.db-shm` sidecar files next to
41
+ the cache.
47
42
 
48
43
  ## What survives, what rebuilds
49
44
 
@@ -224,7 +224,7 @@ Rows are embedded once, at ingest, and cached on disk by content and model
224
224
  ::: warning Editing `ddl` wedges a persisted `vec0` cache
225
225
  Under `--persist`, editing any part of a `ddl` batch whose cache holds a
226
226
  `vec0` table currently fails with `SQLite error: no such module: vec0`, and
227
- keeps failing until the cache is deleted (`rm -rf <root>/.dirsql`). Tracked in
227
+ keeps failing until the cache is deleted (delete it, or pass a fresh `--persist <path>`). Tracked in
228
228
  [#1008](https://github.com/thekevinscott/dirsql/issues/1008); FTS5 is
229
229
  unaffected.
230
230
  :::
@@ -51,9 +51,6 @@ dirsql query "SELECT basename FROM notes ORDER BY basename" -c ./.dirsql.toml
51
51
  list, though its path-tables still apply the built-in
52
52
  [skip rules](../reference/path-tables.md#skip-rules) and respect
53
53
  `.gitignore`.
54
- - The top-level `.dirsql/` directory is always excluded, ignore list or
55
- not — it is reserved for `dirsql`'s own metadata
56
- ([config reference](../reference/config.md#dirsql-keys)).
57
54
  - Narrow table globs are the other half of the story: a file matching no
58
55
  table's glob contributes no rows either. Use `ignore` for things that
59
56
  should never be looked at; use precise globs to shape what each table
@@ -248,7 +248,7 @@ Config flags are subcommand-local: pass them after `server`
248
248
  | `--host <addr>` | `localhost` | Bind address. |
249
249
  | `--port <n>` | `7117` | TCP port to bind. |
250
250
  | `--cors-origin <origin>` | off | Let browser pages on `<origin>` (an exact origin such as `http://localhost:3202`, or `*` for any) call `/query` and open `/events`. See [Cross-origin requests](#cross-origin-requests). |
251
- | `--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). Also available on [`dirsql query`](#dirsql-query). See [Keep the index across restarts](../howto/persist.md). |
251
+ | `--persist [<path>]` | off | Keep the SQLite index on disk between runs so a restart only re-parses files that actually changed. Bare `--persist` caches under the platform cache directory (`$XDG_CACHE_HOME/dirsql/<root hash>/cache.db` on Linux), outside the root; `--persist <path>` caches at `<path>`. Off by default (the index is ephemeral). Also available on [`dirsql query`](#dirsql-query). See [Keep the index across restarts](../howto/persist.md). |
252
252
  | `--no-ignore` | off | Scan files a `.gitignore` would hide. [Path-tables](./path-tables.md#skip-rules) respect `.gitignore` files by default; this flag restores the full walk. The built-in `.git` skip and configured `ignore` patterns still apply. Also available on [`dirsql query`](#dirsql-query). |
253
253
  | `--extension <path>` | none | Load a SQLite extension by literal path, overriding the config's `[[dirsql.extension]]` entries. Repeatable. Format: `<path>` or `<path>::<entrypoint>`. Internal plumbing for the pip/npm launchers, which resolve package-name extensions and pass the resolved paths here — not intended for direct use. When any `--extension` is present, the config file's own extension entries are not loaded. |
254
254
  | `--version` | | Print the version and exit. |
@@ -34,12 +34,6 @@ A config that still declares the removed `hook-timeout` key fails to load with
34
34
  an error naming that replacement. [`[[dirsql.function]]`](#dirsql-function)
35
35
  worker calls have their own per-call `timeout` key (default 30 seconds).
36
36
 
37
- The top-level `.dirsql/` directory under the root is always excluded from
38
- scanning, whether or not it appears in `ignore` — it is reserved for
39
- `dirsql`'s own metadata (the persist cache lives there by default). Only the
40
- top-level `.dirsql/` is reserved; a nested `sub/.dirsql/` is an ordinary
41
- directory.
42
-
43
37
  ```toml
44
38
  [dirsql]
45
39
  ignore = ["node_modules/**", ".git/**"]
@@ -228,8 +228,7 @@ The table itself is per-connection: it lives in `temp`, so it cannot leak into
228
228
  `sqlite_master` or survive a restart. Under `--persist` a *parsed* table's rows
229
229
  outlive the connection in the cache (above), but the table is still minted
230
230
  fresh each run and the scan still decides what exists. A `.dirsql/` directory
231
- at the top of the directory the scan starts in is reserved and excluded, as
232
- everywhere else.
231
+ is an ordinary dot directory.
233
232
 
234
233
  ### When to promote to a declared table
235
234
 
@@ -86,7 +86,7 @@ DirSQL::builder()
86
86
  .config(config_toml_path) // optional; repeatable — call again to
87
87
  // merge another config in call order
88
88
  .persist(cache_path) // optional; Some(path), or None for the
89
- // default <root>/.dirsql/cache.db
89
+ // platform cache dir
90
90
  .extensions(extensions) // optional; append one with .extension(e)
91
91
  .poll_interval(duration) // optional; watch-loop cadence, default 200ms
92
92
  .build() // -> Result<DirSQL> (synchronous scan)
@@ -139,8 +139,8 @@ shortcut was removed in #603 — use
139
139
  accumulate; a duplicate table name across configs errors), mirroring the
140
140
  CLI's repeatable [`-c/--config`](./cli.md#flags).
141
141
  - `persist` — Keep the SQLite index on disk between runs (default off:
142
- ephemeral, rebuilt every startup). The cache lives at
143
- `<root>/.dirsql/cache.db` by default; on restart, only files whose stat
142
+ ephemeral, rebuilt every startup). The cache lives in the
143
+ platform cache directory by default (outside `<root>`); on restart, only files whose stat
144
144
  changed are re-parsed. (The CLI exposes the same switch as the
145
145
  [`--persist [PATH]`](./cli.md#dirsql-server) flag; it is not a config key.)
146
146
  - `persist_path` / `persistPath` — Override the cache location. Ignored when
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.4.101",
3
+ "version": "0.4.102",
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.101",
225
- "@dirsql/lib-linux-arm64-gnu": "0.4.101",
226
- "@dirsql/lib-darwin-x64": "0.4.101",
227
- "@dirsql/lib-darwin-arm64": "0.4.101",
228
- "@dirsql/lib-win32-x64-msvc": "0.4.101"
224
+ "@dirsql/lib-linux-x64-gnu": "0.4.102",
225
+ "@dirsql/lib-linux-arm64-gnu": "0.4.102",
226
+ "@dirsql/lib-darwin-x64": "0.4.102",
227
+ "@dirsql/lib-darwin-arm64": "0.4.102",
228
+ "@dirsql/lib-win32-x64-msvc": "0.4.102"
229
229
  }
230
230
  }