dirsql 0.3.62__tar.gz → 0.3.63__tar.gz
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.
- {dirsql-0.3.62 → dirsql-0.3.63}/Cargo.lock +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/PKG-INFO +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/config.ts +1 -1
- {dirsql-0.3.62/packages/python → dirsql-0.3.63}/docs/getting-started.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/persist.md +2 -2
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/index.md +1 -1
- {dirsql-0.3.62/packages/rust → dirsql-0.3.63}/docs/reference/config.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/sdk.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/Cargo.toml +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/config.ts +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63/packages/python}/docs/getting-started.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/persist.md +2 -2
- {dirsql-0.3.62/packages/rust → dirsql-0.3.63/packages/python}/docs/index.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63/packages/python}/docs/reference/config.md +1 -1
- {dirsql-0.3.62/packages/rust → dirsql-0.3.63/packages/python}/docs/reference/sdk.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/e2e-attestation.json +2 -2
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/getting-started.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/persist.md +2 -2
- {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/index.md +1 -1
- {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/reference/config.md +1 -1
- {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/reference/sdk.md +1 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/config.rs +2 -1
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/db.rs +31 -3
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/lib.rs +3 -3
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/persist.rs +7 -6
- {dirsql-0.3.62 → dirsql-0.3.63}/Cargo.toml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/README.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/_async.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/_dirsql.pyi +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/binary_path.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/interpret/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/is_windows.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/main.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/resolve_config_extensions.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/py.typed +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/resolve_config_extensions.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/resolve_extension.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/AGENTS.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/explanation.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/embed.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/migrations.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/package.json +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/playwright.config.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/cli.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/columns.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/hooks.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/http-api.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/sidebar.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/docs/vitest.config.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/README.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/conftest.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/AGENTS.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/explanation.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/embed.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/migrations.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/package.json +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/playwright.config.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/cli.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/columns.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/hooks.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/http-api.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/sidebar.spec.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/vitest.config.ts +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/src/lib.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/binding/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/conftest.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/e2e/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/integration/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/smoke/__init__.py +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/Cargo.toml +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/README.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/db_bench.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/differ_bench.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/matcher_bench.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/scanner_bench.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/explanation.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/columns-from-paths.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/define-tables.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/embed.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/extract-from-contents.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/load-extension.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/react-to-changes.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/search-by-meaning.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/skip-files.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/migrations.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/cli.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/columns.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/hooks.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/http-api.md +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/bin/dirsql.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/init.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/mod.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/router.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/serialize.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/server.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/command.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/differ.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/matcher.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/scanner.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/watcher.rs +0 -0
- {dirsql-0.3.62 → dirsql-0.3.63}/pyproject.toml +0 -0
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'vitepress'
|
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
title: 'dirsql',
|
|
5
|
-
description: 'Ephemeral SQL index over a local directory. Watches a filesystem, ingests structured files into an
|
|
5
|
+
description: 'Ephemeral SQL index over a local directory. Watches a filesystem, ingests structured files into an ephemeral SQLite database, and exposes a SQL query interface.',
|
|
6
6
|
base: '/dirsql/',
|
|
7
7
|
|
|
8
8
|
themeConfig: {
|
|
@@ -85,7 +85,7 @@ The first run downloads the package (`npx` asks for confirmation — answer
|
|
|
85
85
|
Running at localhost:7117
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
That one command scanned the directory, built an
|
|
88
|
+
That one command scanned the directory, built an ephemeral SQLite database
|
|
89
89
|
with one row per file, and started an HTTP server. Leave it running and
|
|
90
90
|
open a **second terminal** for the next step.
|
|
91
91
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Keep the index across restarts
|
|
2
2
|
|
|
3
|
-
By default the database
|
|
4
|
-
|
|
3
|
+
By default the database is ephemeral: rebuilt from your files on every
|
|
4
|
+
startup and discarded on exit. [`persist`](../reference/config.md#dirsql-keys) keeps the
|
|
5
5
|
SQLite index on disk instead, so a restart only re-parses files that
|
|
6
6
|
actually changed — the difference between seconds and milliseconds on large
|
|
7
7
|
trees, and between re-running and skipping expensive
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
layout: home
|
|
3
3
|
hero:
|
|
4
4
|
name: dirsql
|
|
5
|
-
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an
|
|
5
|
+
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an ephemeral SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
|
|
6
6
|
actions:
|
|
7
7
|
- theme: brand
|
|
8
8
|
text: Get Started
|
|
@@ -20,7 +20,7 @@ set.
|
|
|
20
20
|
|---|---|---|---|
|
|
21
21
|
| `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). |
|
|
22
22
|
| `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. |
|
|
23
|
-
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the
|
|
23
|
+
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the index is ephemeral: rebuilt from your files on every startup and discarded on exit. |
|
|
24
24
|
| `persist_path` | string | `<root>/.dirsql/cache.db` | Location of the on-disk cache. Relative values resolve against the config file's parent. Ignored unless `persist = true`. |
|
|
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). |
|
|
@@ -109,7 +109,7 @@ directory" error.
|
|
|
109
109
|
When both an explicit `root` and a config root are present, the explicit
|
|
110
110
|
value wins and a warning is emitted on stderr.
|
|
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
|
|
114
114
|
changed are re-parsed. `persist = true` in the config also enables it.
|
|
115
115
|
- `persist_path` / `persistPath` — Override the cache location. An
|
|
@@ -4,7 +4,7 @@ name = "dirsql-py-ext"
|
|
|
4
4
|
# pypi/maturin handler can rewrite it via `write-version` before
|
|
5
5
|
# `maturin build`. `pyproject.toml` declares `dynamic = ["version"]`
|
|
6
6
|
# and maturin reads this field. Mirrors `packages/rust/Cargo.toml`.
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.63"
|
|
8
8
|
edition.workspace = true
|
|
9
9
|
publish = false
|
|
10
10
|
readme = "README.md"
|
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'vitepress'
|
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
title: 'dirsql',
|
|
5
|
-
description: 'Ephemeral SQL index over a local directory. Watches a filesystem, ingests structured files into an
|
|
5
|
+
description: 'Ephemeral SQL index over a local directory. Watches a filesystem, ingests structured files into an ephemeral SQLite database, and exposes a SQL query interface.',
|
|
6
6
|
base: '/dirsql/',
|
|
7
7
|
|
|
8
8
|
themeConfig: {
|
|
@@ -85,7 +85,7 @@ The first run downloads the package (`npx` asks for confirmation — answer
|
|
|
85
85
|
Running at localhost:7117
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
That one command scanned the directory, built an
|
|
88
|
+
That one command scanned the directory, built an ephemeral SQLite database
|
|
89
89
|
with one row per file, and started an HTTP server. Leave it running and
|
|
90
90
|
open a **second terminal** for the next step.
|
|
91
91
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Keep the index across restarts
|
|
2
2
|
|
|
3
|
-
By default the database
|
|
4
|
-
|
|
3
|
+
By default the database is ephemeral: rebuilt from your files on every
|
|
4
|
+
startup and discarded on exit. [`persist`](../reference/config.md#dirsql-keys) keeps the
|
|
5
5
|
SQLite index on disk instead, so a restart only re-parses files that
|
|
6
6
|
actually changed — the difference between seconds and milliseconds on large
|
|
7
7
|
trees, and between re-running and skipping expensive
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
layout: home
|
|
3
3
|
hero:
|
|
4
4
|
name: dirsql
|
|
5
|
-
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an
|
|
5
|
+
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an ephemeral SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
|
|
6
6
|
actions:
|
|
7
7
|
- theme: brand
|
|
8
8
|
text: Get Started
|
|
@@ -20,7 +20,7 @@ set.
|
|
|
20
20
|
|---|---|---|---|
|
|
21
21
|
| `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). |
|
|
22
22
|
| `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. |
|
|
23
|
-
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the
|
|
23
|
+
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the index is ephemeral: rebuilt from your files on every startup and discarded on exit. |
|
|
24
24
|
| `persist_path` | string | `<root>/.dirsql/cache.db` | Location of the on-disk cache. Relative values resolve against the config file's parent. Ignored unless `persist = true`. |
|
|
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). |
|
|
@@ -109,7 +109,7 @@ directory" error.
|
|
|
109
109
|
When both an explicit `root` and a config root are present, the explicit
|
|
110
110
|
value wins and a warning is emitted on stderr.
|
|
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
|
|
114
114
|
changed are re-parsed. `persist = true` in the config also enables it.
|
|
115
115
|
- `persist_path` / `persistPath` — Override the cache location. An
|
|
@@ -85,7 +85,7 @@ The first run downloads the package (`npx` asks for confirmation — answer
|
|
|
85
85
|
Running at localhost:7117
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
That one command scanned the directory, built an
|
|
88
|
+
That one command scanned the directory, built an ephemeral SQLite database
|
|
89
89
|
with one row per file, and started an HTTP server. Leave it running and
|
|
90
90
|
open a **second terminal** for the next step.
|
|
91
91
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Keep the index across restarts
|
|
2
2
|
|
|
3
|
-
By default the database
|
|
4
|
-
|
|
3
|
+
By default the database is ephemeral: rebuilt from your files on every
|
|
4
|
+
startup and discarded on exit. [`persist`](../reference/config.md#dirsql-keys) keeps the
|
|
5
5
|
SQLite index on disk instead, so a restart only re-parses files that
|
|
6
6
|
actually changed — the difference between seconds and milliseconds on large
|
|
7
7
|
trees, and between re-running and skipping expensive
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
layout: home
|
|
3
3
|
hero:
|
|
4
4
|
name: dirsql
|
|
5
|
-
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an
|
|
5
|
+
tagline: Ephemeral SQL index over a local directory. `dirsql` watches a filesystem, ingests structured files into an ephemeral SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
|
|
6
6
|
actions:
|
|
7
7
|
- theme: brand
|
|
8
8
|
text: Get Started
|
|
@@ -20,7 +20,7 @@ set.
|
|
|
20
20
|
|---|---|---|---|
|
|
21
21
|
| `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). |
|
|
22
22
|
| `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. |
|
|
23
|
-
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the
|
|
23
|
+
| `persist` | boolean | `false` | Keep the SQLite index on disk between runs. When `false`, the index is ephemeral: rebuilt from your files on every startup and discarded on exit. |
|
|
24
24
|
| `persist_path` | string | `<root>/.dirsql/cache.db` | Location of the on-disk cache. Relative values resolve against the config file's parent. Ignored unless `persist = true`. |
|
|
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). |
|
|
@@ -109,7 +109,7 @@ directory" error.
|
|
|
109
109
|
When both an explicit `root` and a config root are present, the explicit
|
|
110
110
|
value wins and a warning is emitted on stderr.
|
|
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
|
|
114
114
|
changed are re-parsed. `persist = true` in the config also enables it.
|
|
115
115
|
- `persist_path` / `persistPath` — Override the cache location. An
|
|
@@ -204,7 +204,8 @@ pub struct Config {
|
|
|
204
204
|
pub ignore: Vec<String>,
|
|
205
205
|
pub tables: Vec<TableConfig>,
|
|
206
206
|
/// Enable persistent on-disk SQLite cache. When false (the default), the
|
|
207
|
-
/// database is rebuilt
|
|
207
|
+
/// database is rebuilt from scratch on every startup (in an anonymous
|
|
208
|
+
/// disk-backed temp database, #402).
|
|
208
209
|
pub persist: bool,
|
|
209
210
|
/// Optional override for the on-disk cache location. Resolved relative
|
|
210
211
|
/// to the config file's parent directory when relative.
|
|
@@ -105,14 +105,25 @@ pub struct Db {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
impl Db {
|
|
108
|
+
/// Open the default, ephemeral `Db`: an **anonymous disk-backed temp
|
|
109
|
+
/// database** (`Connection::open("")`, issue #402), not `:memory:`.
|
|
110
|
+
///
|
|
111
|
+
/// SQLite creates a private temp file and deletes it immediately after
|
|
112
|
+
/// opening, so the OS reclaims it even on a crash or SIGKILL, and there
|
|
113
|
+
/// is never a name to collide on. Pages spill to disk as the index
|
|
114
|
+
/// grows — only the page cache stays resident — so memory no longer
|
|
115
|
+
/// scales with the indexed corpus. The file lands in the directory
|
|
116
|
+
/// SQLite's VFS picks (`SQLITE_TMPDIR` → `TMPDIR` → `/var/tmp` →
|
|
117
|
+
/// `/usr/tmp` → `/tmp`); export `SQLITE_TMPDIR` to steer it off a
|
|
118
|
+
/// tmpfs mount.
|
|
108
119
|
pub fn new() -> Result<Self> {
|
|
109
|
-
let conn = Connection::
|
|
120
|
+
let conn = Connection::open("")?;
|
|
110
121
|
ensure_internal_rows_table(&conn)?;
|
|
111
122
|
Ok(Self { conn })
|
|
112
123
|
}
|
|
113
124
|
|
|
114
|
-
/// Open a `Db` backed by
|
|
115
|
-
/// cache path;
|
|
125
|
+
/// Open a `Db` backed by a named on-disk SQLite file. Used by the
|
|
126
|
+
/// persistent cache path; the anonymous temp database is the default.
|
|
116
127
|
pub fn open(path: &Path) -> Result<Self> {
|
|
117
128
|
let conn = Connection::open(path)?;
|
|
118
129
|
ensure_internal_rows_table(&conn)?;
|
|
@@ -1256,6 +1267,23 @@ mod tests {
|
|
|
1256
1267
|
assert_eq!(deleted, 0);
|
|
1257
1268
|
}
|
|
1258
1269
|
|
|
1270
|
+
// --- Db::new backing store (#402) ---
|
|
1271
|
+
|
|
1272
|
+
#[test]
|
|
1273
|
+
fn new_is_disk_backed_not_memory() {
|
|
1274
|
+
// An in-memory SQLite database is pinned to journal_mode=memory; a
|
|
1275
|
+
// file-backed one — including the anonymous temp database `Db::new`
|
|
1276
|
+
// opens — defaults to journal_mode=delete. This pins #402: the
|
|
1277
|
+
// default Db must never be `:memory:`, so index pages spill to disk
|
|
1278
|
+
// instead of scaling resident memory with the corpus.
|
|
1279
|
+
let db = Db::new().unwrap();
|
|
1280
|
+
let mode: String = db
|
|
1281
|
+
.conn()
|
|
1282
|
+
.query_row("PRAGMA journal_mode", [], |row| row.get(0))
|
|
1283
|
+
.unwrap();
|
|
1284
|
+
assert_eq!(mode, "delete");
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1259
1287
|
// --- get_rows_by_file: the watcher's diffing source (#401) ---
|
|
1260
1288
|
|
|
1261
1289
|
#[test]
|
|
@@ -325,14 +325,14 @@ impl DirSQL {
|
|
|
325
325
|
.build()
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
/// Run a SQL query against the
|
|
328
|
+
/// Run a SQL query against the ephemeral database.
|
|
329
329
|
///
|
|
330
330
|
/// Only read-only statements are accepted. Each statement is prepared on
|
|
331
331
|
/// SQLite and then classified via `sqlite3_stmt_readonly`; anything that
|
|
332
332
|
/// SQLite itself flags as a write — `INSERT`, `UPDATE`, `DELETE`, `DROP`,
|
|
333
333
|
/// `CREATE`, `ALTER`, `REPLACE`, `VACUUM`, `ANALYZE`, etc. — is rejected
|
|
334
334
|
/// with [`DirSqlError::WriteForbidden`] before any rows are produced. This
|
|
335
|
-
/// keeps the
|
|
335
|
+
/// keeps the ephemeral index consistent with the on-disk files that back
|
|
336
336
|
/// it: mutations only happen through the watcher/indexer pipeline.
|
|
337
337
|
pub fn query(&self, sql: &str) -> Result<Vec<Row>> {
|
|
338
338
|
let db = self.inner.db.lock().map_err(DirSqlError::lock)?;
|
|
@@ -355,7 +355,7 @@ impl DirSQL {
|
|
|
355
355
|
|
|
356
356
|
/// Poll-based watch API. Blocks up to `timeout` waiting for the next
|
|
357
357
|
/// filesystem event, then drains any additional events that arrived during
|
|
358
|
-
/// processing, applying all of them to the
|
|
358
|
+
/// processing, applying all of them to the ephemeral database. Returns the
|
|
359
359
|
/// batch of [`RowEvent`]s produced (possibly empty). Safe to call in a
|
|
360
360
|
/// loop.
|
|
361
361
|
///
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
//! Persistent on-disk SQLite cache (issue #95).
|
|
2
2
|
//!
|
|
3
|
-
//! Stores the
|
|
4
|
-
//! startups only re-parse files that have actually changed. Uses
|
|
5
|
-
//! racy-stat algorithm as `git status`: a per-file `(size, mtime,
|
|
6
|
-
//! inode, dev)` tuple is compared against the cache, with a
|
|
7
|
-
//! confirmation for files whose mtime falls inside the racy
|
|
3
|
+
//! Stores the SQLite database at a named on-disk path between runs so
|
|
4
|
+
//! subsequent startups only re-parse files that have actually changed. Uses
|
|
5
|
+
//! the same racy-stat algorithm as `git status`: a per-file `(size, mtime,
|
|
6
|
+
//! ctime, inode, dev)` tuple is compared against the cache, with a
|
|
7
|
+
//! content-hash confirmation for files whose mtime falls inside the racy
|
|
8
|
+
//! window.
|
|
8
9
|
//!
|
|
9
|
-
//! See `docs/
|
|
10
|
+
//! See `docs/howto/persist.md` for the user-facing contract.
|
|
10
11
|
|
|
11
12
|
use rusqlite::{Connection, params};
|
|
12
13
|
use std::collections::{BTreeMap, HashMap};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/language-flag.spec.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|