dirsql 0.4.62 → 0.4.64

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.
@@ -81,11 +81,15 @@ The first run downloads the package (`npx` asks for confirmation — answer
81
81
  `y`; `uvx` prints download progress), then prints the result:
82
82
 
83
83
  ```
84
- [{"files":3}]
84
+ files
85
+ -----
86
+ 3
87
+
88
+ 1 row
85
89
  ```
86
90
 
87
91
  Three files, three rows. That one command scanned the directory, handed
88
- SQLite one row per file, ran your SQL, and printed the answer as JSON.
92
+ SQLite one row per file, ran your SQL, and printed the answer.
89
93
 
90
94
  There is no named table here — you never declared one. `'./'` is a
91
95
  [path-table](./reference/path-tables.md): a quoted path written where a table
@@ -94,8 +98,9 @@ in. The path *is* the query.
94
98
 
95
99
  ## 3. Select some columns
96
100
 
97
- The response is always a JSON array of row objects, so from here on we pipe
98
- it through `jq` to pretty-print. Ask for two columns instead of a count:
101
+ At a terminal `dirsql` prints a table; when its output is piped, it prints a
102
+ JSON array of row objects instead. From here on we pipe it through `jq` to
103
+ pretty-print. Ask for two columns instead of a count:
99
104
 
100
105
  ::: code-group
101
106
 
@@ -60,11 +60,12 @@ its `embed()` SQL function),
60
60
  and [`ignore`](../reference/config.md#dirsql-keys).
61
61
 
62
62
  There are **no plugin-specific keys and no plugin-specific restrictions**. The
63
- config schema is content-only: the index `root` and `--persist` are
64
- [runner-owned flags](../reference/config.md#dirsql-keys) (`--root`, `--persist
65
- [PATH]`), decided by whoever runs `dirsql`, never by a config file — so a
66
- plugin has nothing to say about them. Whatever you can put in your own
67
- `.dirsql.toml`, a plugin can put in its fragment, and vice-versa.
63
+ config schema is content-only: the index root and persistence are
64
+ [runner-owned](../reference/config.md#dirsql-keys) — the root is the directory
65
+ `dirsql` is run from (or an SDK's explicit `root`), persistence is the
66
+ `--persist [PATH]` flag — decided by whoever runs `dirsql`, never by a config
67
+ file, so a plugin has nothing to say about them. Whatever you can put in your
68
+ own `.dirsql.toml`, a plugin can put in its fragment, and vice-versa.
68
69
 
69
70
  ## Hook commands
70
71
 
@@ -1,11 +1,13 @@
1
1
  # CLI
2
2
 
3
- Query is the default: `dirsql "<sql>"` runs one query and prints JSON rows.
3
+ Query is the default: `dirsql "<sql>"` runs one query and prints the rows —
4
+ a table at a terminal, a JSON array when piped (see
5
+ [Output format](#output-format)).
4
6
  The `dirsql` binary has these modes:
5
7
 
6
8
  | Invocation | Behavior |
7
9
  |---|---|
8
- | `dirsql "<sql>"` | Run one query over the directory and print the rows as JSON. The default; identical to `dirsql query "<sql>"`. |
10
+ | `dirsql "<sql>"` | Run one query over the directory and print the rows. The default; identical to `dirsql query "<sql>"`. |
9
11
  | `dirsql query "<sql>"` | Explicit synonym for the default one-shot query. |
10
12
  | `dirsql server` | Start a long-lived HTTP server exposing a SQL view of a directory. See [HTTP API](./http-api.md). |
11
13
  | `dirsql init` | Generate a `.dirsql.toml`. |
@@ -53,7 +55,7 @@ pipeline, same flags, same output. See that section for config discovery,
53
55
 
54
56
  ```bash
55
57
  dirsql
56
- # dirsql 0.2.7 — this directory is a database.
58
+ # dirsql <version> — this directory is a database.
57
59
  #
58
60
  # SELECT basename, size FROM './' ORDER BY size DESC LIMIT 5;
59
61
  # SELECT path FROM './**/*.md' WHERE content LIKE '%TODO%';
@@ -331,9 +333,10 @@ is a hard error — `error: the subcommand 'query' cannot be used with
331
333
  for the server they follow the subcommand: `dirsql server -c <cfg>`.)
332
334
  :::
333
335
 
334
- The subcommand builds the index, runs the SQL, prints the result rows as a
335
- JSON array on stdout (byte-identical to the [`POST /query`](./http-api.md)
336
- response body), and exits `0`.
336
+ The subcommand builds the index, runs the SQL, prints the result rows on
337
+ stdout — a table at a terminal, otherwise a JSON array byte-identical to the
338
+ [`POST /query`](./http-api.md) response body (see
339
+ [Output format](#output-format)) — and exits `0`.
337
340
 
338
341
  `dirsql query` is a thin adapter over the **same query pipeline the server
339
342
  uses**, so behavior is identical to `POST /query` by construction:
@@ -413,7 +416,7 @@ The output does **not** auto-load. Once you've tweaked it, pass it explicitly
413
416
  to run against it:
414
417
 
415
418
  ```bash
416
- dirsql "SELECT * FROM files" -c ./.dirsql.toml
419
+ dirsql "SELECT * FROM records" -c ./.dirsql.toml
417
420
  ```
418
421
 
419
422
  ### Flags
@@ -54,6 +54,7 @@ DirSQL(
54
54
  *,
55
55
  tables: list[Table] | None = None,
56
56
  ignore: list[str] | None = None,
57
+ no_ignore: bool = False,
57
58
  config: str | list[str] | None = None,
58
59
  persist: bool = False,
59
60
  persist_path: str | None = None,
@@ -68,6 +69,7 @@ new DirSQL({
68
69
  root?: string,
69
70
  tables?: TableDef[],
70
71
  ignore?: string[],
72
+ noIgnore?: boolean,
71
73
  config?: string | string[],
72
74
  persist?: boolean,
73
75
  persistPath?: string,
@@ -80,6 +82,7 @@ DirSQL::builder()
80
82
  .root(root) // optional
81
83
  .tables(tables) // optional; append one with .table(t)
82
84
  .ignore(patterns) // optional
85
+ .no_ignore(true) // optional; default false
83
86
  .config(config_toml_path) // optional; repeatable — call again to
84
87
  // merge another config in call order
85
88
  .persist(cache_path) // optional; Some(path), or None for the
@@ -115,6 +118,10 @@ shortcut was removed in #603 — use
115
118
  - `tables` — Programmatic [`Table`](#table) definitions.
116
119
  - `ignore` — Glob patterns matched against root-relative paths; matched
117
120
  files are skipped entirely (scan and watch).
121
+ - `no_ignore` / `noIgnore` — Scan files a `.gitignore` would hide.
122
+ [Path-tables](./path-tables.md#skip-rules) respect `.gitignore` files by
123
+ default; the built-in `node_modules`/`.git` skips and any `ignore` patterns
124
+ still apply. The CLI's [`--no-ignore`](./cli.md#flags).
118
125
  - `config` — Path to a [`.dirsql.toml`](./config.md). Its `[[table]]`
119
126
  entries are appended after any programmatic `tables`; its `ignore`
120
127
  patterns and `[[dirsql.extension]]` entries are appended likewise. The
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.4.62",
3
+ "version": "0.4.64",
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.62",
225
- "@dirsql/lib-linux-arm64-gnu": "0.4.62",
226
- "@dirsql/lib-darwin-x64": "0.4.62",
227
- "@dirsql/lib-darwin-arm64": "0.4.62",
228
- "@dirsql/lib-win32-x64-msvc": "0.4.62"
224
+ "@dirsql/lib-linux-x64-gnu": "0.4.64",
225
+ "@dirsql/lib-linux-arm64-gnu": "0.4.64",
226
+ "@dirsql/lib-darwin-x64": "0.4.64",
227
+ "@dirsql/lib-darwin-arm64": "0.4.64",
228
+ "@dirsql/lib-win32-x64-msvc": "0.4.64"
229
229
  }
230
230
  }