dirsql 0.4.67 → 0.4.68
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
|
@@ -68,11 +68,11 @@ this directory anyway — from inside `my-notes`, run one command:
|
|
|
68
68
|
::: code-group
|
|
69
69
|
|
|
70
70
|
```bash [npm]
|
|
71
|
-
npx dirsql "SELECT COUNT(*) AS files FROM '
|
|
71
|
+
npx dirsql "SELECT COUNT(*) AS files FROM './**'"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
```bash [PyPI]
|
|
75
|
-
uvx dirsql "SELECT COUNT(*) AS files FROM '
|
|
75
|
+
uvx dirsql "SELECT COUNT(*) AS files FROM './**'"
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
:::
|
|
@@ -91,10 +91,11 @@ files
|
|
|
91
91
|
Three files, three rows. That one command scanned the directory, handed
|
|
92
92
|
SQLite one row per file, ran your SQL, and printed the answer.
|
|
93
93
|
|
|
94
|
-
There is no named table here — you never declared one. `'
|
|
94
|
+
There is no named table here — you never declared one. `'./**'` is a
|
|
95
95
|
[path-table](./reference/path-tables.md): a quoted path written where a table
|
|
96
|
-
name goes. `'
|
|
97
|
-
in
|
|
96
|
+
name goes. `'./**'` means every file under the directory you ran the command
|
|
97
|
+
in, at any depth; `'./'` alone would list only the files directly inside it,
|
|
98
|
+
like `ls`. The path *is* the query.
|
|
98
99
|
|
|
99
100
|
## 3. Select some columns
|
|
100
101
|
|
|
@@ -105,11 +106,11 @@ pretty-print. Ask for two columns instead of a count:
|
|
|
105
106
|
::: code-group
|
|
106
107
|
|
|
107
108
|
```bash [npm]
|
|
108
|
-
npx dirsql query "SELECT path, size FROM '
|
|
109
|
+
npx dirsql query "SELECT path, size FROM './**' ORDER BY path" | jq
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
```bash [PyPI]
|
|
112
|
-
uvx dirsql query "SELECT path, size FROM '
|
|
113
|
+
uvx dirsql query "SELECT path, size FROM './**' ORDER BY path" | jq
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
:::
|
|
@@ -67,5 +67,5 @@ why indexes belong to only one of them, are in
|
|
|
67
67
|
- Paths outside the root resolve too — `'/var/log/*.log'`, `'../notes'`,
|
|
68
68
|
`'~/notes/*.md'` — reporting absolute paths
|
|
69
69
|
([path-tables reference](../reference/path-tables.md#paths-outside-the-index-root)).
|
|
70
|
-
- `node_modules/` and `.git/` are skipped by default so a bare `'
|
|
71
|
-
drown in machinery ([skip rules](../reference/path-tables.md#skip-rules)).
|
|
70
|
+
- `node_modules/` and `.git/` are skipped by default so a bare `'./**'` does
|
|
71
|
+
not drown in machinery ([skip rules](../reference/path-tables.md#skip-rules)).
|
package/docs/reference/cli.md
CHANGED
|
@@ -88,7 +88,7 @@ front.
|
|
|
88
88
|
### Output format
|
|
89
89
|
|
|
90
90
|
Rows go where they are useful: a **table** when stdout is a terminal, the
|
|
91
|
-
**JSON array** when it is piped or redirected. `SELECT * FROM '
|
|
91
|
+
**JSON array** when it is piped or redirected. `SELECT * FROM './**'` in a
|
|
92
92
|
5000-file tree should not put a 5000-element JSON array in front of a person,
|
|
93
93
|
and `dirsql "…" | jq` should not have to parse a table.
|
|
94
94
|
|
|
@@ -283,7 +283,7 @@ curl -s localhost:7117/query -H 'content-type: application/json' \
|
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
Earlier versions served an implicit table named `files` here. It is gone; a
|
|
286
|
-
`SELECT ... FROM files` with no config now fails and points at `FROM '
|
|
286
|
+
`SELECT ... FROM files` with no config now fails and points at `FROM './**'`.
|
|
287
287
|
|
|
288
288
|
Passing a config with `-c` fully overrules this default. A `-c` naming a file
|
|
289
289
|
that does not exist is an error (not a fallback to the default); a config that
|
|
@@ -403,8 +403,8 @@ takes, with the same `auto` default. A one-shot query is usually piped, so
|
|
|
403
403
|
## `dirsql init`
|
|
404
404
|
|
|
405
405
|
Writes a starter `.dirsql.toml` as a scaffold to edit. It does **not**
|
|
406
|
-
duplicate the zero-config floor (`SELECT * FROM '
|
|
407
|
-
with no config); instead it shows the **escalation**: one named `[[table]]`
|
|
406
|
+
duplicate the zero-config floor (`SELECT * FROM './**'` already lists every
|
|
407
|
+
file with no config); instead it shows the **escalation**: one named `[[table]]`
|
|
408
408
|
with a glob, a schema, and a real `on-file` hook that pulls structured rows
|
|
409
409
|
out of your files.
|
|
410
410
|
|
package/docs/reference/config.md
CHANGED
|
@@ -396,7 +396,7 @@ SDKs raise/reject) when:
|
|
|
396
396
|
- A `[[table]]` entry omits `on-file` (or it is empty/whitespace). The error
|
|
397
397
|
names the offending glob and points at the fix:
|
|
398
398
|
|
|
399
|
-
> `[[table]] '**/*.md' has no on-file hook, so every row would be all-NULL. Add an `on-file` hook that emits the columns, or, for stat columns with no code, query the path directly: `FROM '
|
|
399
|
+
> `[[table]] '**/*.md' has no on-file hook, so every row would be all-NULL. Add an `on-file` hook that emits the columns, or, for stat columns with no code, query the path directly: `FROM './**'``
|
|
400
400
|
|
|
401
401
|
- A `[[dirsql.extension]]` entry omits `path`, or `path` is empty.
|
|
402
402
|
- A `[[dirsql.function]]` entry omits `name`, `command`, or `args` (or
|
|
@@ -35,14 +35,16 @@ Two consequences follow directly:
|
|
|
35
35
|
A `./` path is relative to the **index root** — the directory dirsql is
|
|
36
36
|
indexing, not your shell's working directory.
|
|
37
37
|
|
|
38
|
-
**
|
|
39
|
-
|
|
38
|
+
**A directory name is one level, like `ls`.** Naming a directory lists the
|
|
39
|
+
files directly inside it and no deeper; `*` matches one level and `**` any
|
|
40
|
+
depth, as in the shell.
|
|
40
41
|
|
|
41
42
|
| You write | dirsql scans |
|
|
42
43
|
| --- | --- |
|
|
43
|
-
| `'./'` |
|
|
44
|
-
| `'./docs'` |
|
|
45
|
-
| `'./*'` |
|
|
44
|
+
| `'./'` | files directly inside the index root, and no deeper |
|
|
45
|
+
| `'./docs'`, `'./docs/'` | files directly inside `docs/` |
|
|
46
|
+
| `'./*'` | the same as `'./'` |
|
|
47
|
+
| `'./**'` | every file under the index root, recursively |
|
|
46
48
|
| `'./docs/*.md'` | markdown files directly inside `docs/` |
|
|
47
49
|
| `'./docs/**/*.md'` | markdown files at any depth under `docs/` |
|
|
48
50
|
| `'./notes/today.md'` | exactly that one file — one file is one row |
|
|
@@ -87,6 +89,7 @@ Three other prefixes resolve, with their usual shell meanings:
|
|
|
87
89
|
| `'../notes'` | relative to the index root's parent |
|
|
88
90
|
| `'~/notes/*.md'` | relative to your home directory |
|
|
89
91
|
|
|
92
|
+
A directory named this way is one level too; `'../notes/**'` descends.
|
|
90
93
|
`..` is folded out textually, not followed through symlinks, so the directory
|
|
91
94
|
scanned is a function of the string you wrote.
|
|
92
95
|
|
|
@@ -216,7 +219,7 @@ A path-table scan applies the same [`ignore`](/reference/config) patterns your
|
|
|
216
219
|
declared tables use — matched against root-relative paths under the same
|
|
217
220
|
[glob rule](/reference/config#glob-rule) as the path itself, `*` one level and
|
|
218
221
|
`**` any depth — plus two built-in defaults so a zero-config
|
|
219
|
-
`SELECT * FROM '
|
|
222
|
+
`SELECT * FROM './**'` does not drown in machinery:
|
|
220
223
|
|
|
221
224
|
- `**/node_modules/**`
|
|
222
225
|
- `**/.git/**`
|
|
@@ -246,7 +249,7 @@ Skip rules are judged from the directory the scan starts in, so pointing at a
|
|
|
246
249
|
skipped directory — built-in or gitignored — still scans it:
|
|
247
250
|
|
|
248
251
|
```sql
|
|
249
|
-
SELECT path FROM '
|
|
252
|
+
SELECT path FROM './**'; -- no node_modules rows
|
|
250
253
|
SELECT path FROM './node_modules/*/package.json'; -- scans it anyway
|
|
251
254
|
SELECT path FROM './dist'; -- scans dist/ even when gitignored
|
|
252
255
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.68",
|
|
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.68",
|
|
225
|
+
"@dirsql/lib-linux-arm64-gnu": "0.4.68",
|
|
226
|
+
"@dirsql/lib-darwin-x64": "0.4.68",
|
|
227
|
+
"@dirsql/lib-darwin-arm64": "0.4.68",
|
|
228
|
+
"@dirsql/lib-win32-x64-msvc": "0.4.68"
|
|
229
229
|
}
|
|
230
230
|
}
|