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.
Files changed (136) hide show
  1. {dirsql-0.3.62 → dirsql-0.3.63}/Cargo.lock +1 -1
  2. {dirsql-0.3.62 → dirsql-0.3.63}/PKG-INFO +1 -1
  3. {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/config.ts +1 -1
  4. {dirsql-0.3.62/packages/python → dirsql-0.3.63}/docs/getting-started.md +1 -1
  5. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/persist.md +2 -2
  6. {dirsql-0.3.62 → dirsql-0.3.63}/docs/index.md +1 -1
  7. {dirsql-0.3.62/packages/rust → dirsql-0.3.63}/docs/reference/config.md +1 -1
  8. {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/sdk.md +1 -1
  9. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/Cargo.toml +1 -1
  10. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/config.ts +1 -1
  11. {dirsql-0.3.62 → dirsql-0.3.63/packages/python}/docs/getting-started.md +1 -1
  12. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/persist.md +2 -2
  13. {dirsql-0.3.62/packages/rust → dirsql-0.3.63/packages/python}/docs/index.md +1 -1
  14. {dirsql-0.3.62 → dirsql-0.3.63/packages/python}/docs/reference/config.md +1 -1
  15. {dirsql-0.3.62/packages/rust → dirsql-0.3.63/packages/python}/docs/reference/sdk.md +1 -1
  16. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/e2e-attestation.json +2 -2
  17. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/getting-started.md +1 -1
  18. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/persist.md +2 -2
  19. {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/index.md +1 -1
  20. {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/reference/config.md +1 -1
  21. {dirsql-0.3.62/packages/python → dirsql-0.3.63/packages/rust}/docs/reference/sdk.md +1 -1
  22. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/config.rs +2 -1
  23. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/db.rs +31 -3
  24. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/lib.rs +3 -3
  25. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/persist.rs +7 -6
  26. {dirsql-0.3.62 → dirsql-0.3.63}/Cargo.toml +0 -0
  27. {dirsql-0.3.62 → dirsql-0.3.63}/README.md +0 -0
  28. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/__init__.py +0 -0
  29. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/_async.py +0 -0
  30. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/_dirsql.pyi +0 -0
  31. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/__init__.py +0 -0
  32. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/binary_path.py +0 -0
  33. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/interpret/__init__.py +0 -0
  34. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/is_windows.py +0 -0
  35. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/main.py +0 -0
  36. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/cli/resolve_config_extensions.py +0 -0
  37. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/py.typed +0 -0
  38. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/resolve_config_extensions.py +0 -0
  39. {dirsql-0.3.62 → dirsql-0.3.63}/dirsql/resolve_extension.py +0 -0
  40. {dirsql-0.3.62 → dirsql-0.3.63}/docs/.claude/CLAUDE.md +0 -0
  41. {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/theme/index.ts +0 -0
  42. {dirsql-0.3.62 → dirsql-0.3.63}/docs/.vitepress/theme/lang.ts +0 -0
  43. {dirsql-0.3.62 → dirsql-0.3.63}/docs/AGENTS.md +0 -0
  44. {dirsql-0.3.62 → dirsql-0.3.63}/docs/explanation.md +0 -0
  45. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/columns-from-paths.md +0 -0
  46. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/define-tables.md +0 -0
  47. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/embed.md +0 -0
  48. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/extract-from-contents.md +0 -0
  49. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/load-extension.md +0 -0
  50. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/react-to-changes.md +0 -0
  51. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/search-by-meaning.md +0 -0
  52. {dirsql-0.3.62 → dirsql-0.3.63}/docs/howto/skip-files.md +0 -0
  53. {dirsql-0.3.62 → dirsql-0.3.63}/docs/migrations.md +0 -0
  54. {dirsql-0.3.62 → dirsql-0.3.63}/docs/package.json +0 -0
  55. {dirsql-0.3.62 → dirsql-0.3.63}/docs/playwright.config.ts +0 -0
  56. {dirsql-0.3.62 → dirsql-0.3.63}/docs/pnpm-lock.yaml +0 -0
  57. {dirsql-0.3.62 → dirsql-0.3.63}/docs/pnpm-workspace.yaml +0 -0
  58. {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/cli.md +0 -0
  59. {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/columns.md +0 -0
  60. {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/hooks.md +0 -0
  61. {dirsql-0.3.62 → dirsql-0.3.63}/docs/reference/http-api.md +0 -0
  62. {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/home.spec.ts +0 -0
  63. {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/language-flag.spec.ts +0 -0
  64. {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/integration/sidebar.spec.ts +0 -0
  65. {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/unit/config.test.ts +0 -0
  66. {dirsql-0.3.62 → dirsql-0.3.63}/docs/tests/unit/lang.test.ts +0 -0
  67. {dirsql-0.3.62 → dirsql-0.3.63}/docs/vitest.config.ts +0 -0
  68. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/README.md +0 -0
  69. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/conftest.py +0 -0
  70. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.claude/CLAUDE.md +0 -0
  71. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/theme/index.ts +0 -0
  72. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/.vitepress/theme/lang.ts +0 -0
  73. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/AGENTS.md +0 -0
  74. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/explanation.md +0 -0
  75. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/columns-from-paths.md +0 -0
  76. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/define-tables.md +0 -0
  77. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/embed.md +0 -0
  78. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/extract-from-contents.md +0 -0
  79. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/load-extension.md +0 -0
  80. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/react-to-changes.md +0 -0
  81. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/search-by-meaning.md +0 -0
  82. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/howto/skip-files.md +0 -0
  83. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/migrations.md +0 -0
  84. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/package.json +0 -0
  85. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/playwright.config.ts +0 -0
  86. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/pnpm-lock.yaml +0 -0
  87. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/pnpm-workspace.yaml +0 -0
  88. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/cli.md +0 -0
  89. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/columns.md +0 -0
  90. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/hooks.md +0 -0
  91. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/reference/http-api.md +0 -0
  92. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/home.spec.ts +0 -0
  93. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/language-flag.spec.ts +0 -0
  94. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/integration/sidebar.spec.ts +0 -0
  95. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/unit/config.test.ts +0 -0
  96. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/tests/unit/lang.test.ts +0 -0
  97. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/docs/vitest.config.ts +0 -0
  98. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/src/lib.rs +0 -0
  99. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/__init__.py +0 -0
  100. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/binding/__init__.py +0 -0
  101. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/conftest.py +0 -0
  102. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/e2e/__init__.py +0 -0
  103. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/integration/__init__.py +0 -0
  104. {dirsql-0.3.62 → dirsql-0.3.63}/packages/python/tests/smoke/__init__.py +0 -0
  105. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/Cargo.toml +0 -0
  106. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/README.md +0 -0
  107. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/db_bench.rs +0 -0
  108. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/differ_bench.rs +0 -0
  109. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/matcher_bench.rs +0 -0
  110. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/benches/scanner_bench.rs +0 -0
  111. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/explanation.md +0 -0
  112. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/columns-from-paths.md +0 -0
  113. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/define-tables.md +0 -0
  114. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/embed.md +0 -0
  115. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/extract-from-contents.md +0 -0
  116. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/load-extension.md +0 -0
  117. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/react-to-changes.md +0 -0
  118. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/search-by-meaning.md +0 -0
  119. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/howto/skip-files.md +0 -0
  120. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/migrations.md +0 -0
  121. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/cli.md +0 -0
  122. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/columns.md +0 -0
  123. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/hooks.md +0 -0
  124. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/docs/reference/http-api.md +0 -0
  125. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/bin/dirsql.rs +0 -0
  126. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/init.rs +0 -0
  127. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/mod.rs +0 -0
  128. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/router.rs +0 -0
  129. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/serialize.rs +0 -0
  130. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/cli/server.rs +0 -0
  131. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/command.rs +0 -0
  132. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/differ.rs +0 -0
  133. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/matcher.rs +0 -0
  134. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/scanner.rs +0 -0
  135. {dirsql-0.3.62 → dirsql-0.3.63}/packages/rust/src/watcher.rs +0 -0
  136. {dirsql-0.3.62 → dirsql-0.3.63}/pyproject.toml +0 -0
@@ -500,7 +500,7 @@ dependencies = [
500
500
 
501
501
  [[package]]
502
502
  name = "dirsql-py-ext"
503
- version = "0.3.62"
503
+ version = "0.3.63"
504
504
  dependencies = [
505
505
  "dirsql",
506
506
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dirsql
3
- Version: 0.3.62
3
+ Version: 0.3.63
4
4
  Requires-Dist: pytest>=8 ; extra == 'dev'
5
5
  Requires-Dist: pytest-describe>=2 ; extra == 'dev'
6
6
  Requires-Dist: pytest-asyncio>=0.23 ; extra == 'dev'
@@ -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 in-memory SQLite database, and exposes a SQL query interface.',
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 in-memory SQLite database
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 lives in memory and is rebuilt from your files on
4
- every startup. [`persist`](../reference/config.md#dirsql-keys) keeps the
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 in-memory SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
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 database is rebuilt in memory on every startup. |
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
- in-memory, rebuilt every startup). The cache lives at
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.62"
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 in-memory SQLite database, and exposes a SQL query interface.',
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 in-memory SQLite database
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 lives in memory and is rebuilt from your files on
4
- every startup. [`persist`](../reference/config.md#dirsql-keys) keeps the
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 in-memory SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
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 database is rebuilt in memory on every startup. |
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
- in-memory, rebuilt every startup). The cache lives at
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "command": "uv run python -m pytest tests/e2e/ -x -q",
3
- "ran_at": 1783182399,
3
+ "ran_at": 1783184817,
4
4
  "exit_code": 0,
5
- "commit": "f26da60822c101e45dee58c80d7b6cbd2d4a0646"
5
+ "commit": "ff790f3535072982be3fa349de4caf8c855fc406"
6
6
  }
@@ -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 in-memory SQLite database
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 lives in memory and is rebuilt from your files on
4
- every startup. [`persist`](../reference/config.md#dirsql-keys) keeps the
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 in-memory SQLite database, and exposes a SQL query interface. The filesystem is always the source of truth.
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 database is rebuilt in memory on every startup. |
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
- in-memory, rebuilt every startup). The cache lives at
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 in memory on every startup.
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::open_in_memory()?;
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 an on-disk SQLite file. Used by the persistent
115
- /// cache path; in-memory mode is the default.
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 in-memory database.
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 in-memory index consistent with the on-disk files that back
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 in-memory database. Returns 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 in-memory SQLite database on disk between runs so subsequent
4
- //! startups only re-parse files that have actually changed. Uses the same
5
- //! racy-stat algorithm as `git status`: a per-file `(size, mtime, ctime,
6
- //! inode, dev)` tuple is compared against the cache, with a content-hash
7
- //! confirmation for files whose mtime falls inside the racy window.
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/guide/persistence.md` for the user-facing contract.
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