dirsql 0.4.119 → 0.4.120
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/reference/cli.md +34 -6
- package/package.json +6 -6
package/docs/reference/cli.md
CHANGED
|
@@ -240,18 +240,46 @@ requests, closes open `/events` streams, and exits.
|
|
|
240
240
|
Pass `--frontend` to serve the bundled dirsql SQL explorer shell at `/` on
|
|
241
241
|
the same origin as the HTTP API. It works offline and prints `Frontend at
|
|
242
242
|
http://<host>:<actual-port>/` without opening a browser. With `--port 0`, the
|
|
243
|
-
printed URL uses the assigned port. The
|
|
244
|
-
query
|
|
243
|
+
printed URL uses the assigned port. The page offers an editable SQL box
|
|
244
|
+
holding the starter query `SELECT * FROM './' LIMIT 100`. Nothing runs until
|
|
245
|
+
you press **Run** (or Ctrl/Cmd+Enter); pressing it again refreshes the
|
|
246
|
+
result. Queries go through `POST /query`, so the read-only rule applies, and
|
|
247
|
+
run exactly as written. The page shows elapsed time, the number of rows
|
|
248
|
+
returned, and errors. Values render as text (`NULL` is marked), and only the
|
|
249
|
+
first 1000 rows are displayed. An empty result says so and shows no column
|
|
250
|
+
names, since the response carries none.
|
|
245
251
|
|
|
246
252
|
```bash
|
|
247
253
|
dirsql server --frontend
|
|
248
254
|
dirsql server --frontend -c .dirsql.toml
|
|
249
255
|
```
|
|
250
256
|
|
|
251
|
-
The shell reads `GET /frontend/state
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
The shell reads `GET /frontend/state`. When the index is ready it returns
|
|
258
|
+
HTTP `200`:
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"error": null,
|
|
263
|
+
"root": "/abs/path/of/the/invocation/directory",
|
|
264
|
+
"tables": [
|
|
265
|
+
{"name": "posts", "columns": [{"name": "basename", "type": "TEXT"}]}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
`root` is the query root, where [path-tables](./path-tables.md) resolve.
|
|
271
|
+
`tables` lists the declared tables, ordered by name, each with its columns in
|
|
272
|
+
declaration order and the declared SQLite type (`""` when untyped). Empty
|
|
273
|
+
tables are listed. A configless server, or a config with only functions or
|
|
274
|
+
extensions, returns `"tables": []`. dirsql's bookkeeping tables, SQLite's own
|
|
275
|
+
tables, virtual tables with their shadow tables, and path-tables are never
|
|
276
|
+
listed. The metadata is read from SQLite's catalog: no file is parsed, no
|
|
277
|
+
directory walked, no table counted.
|
|
278
|
+
|
|
279
|
+
When config loading fails the endpoint returns HTTP `503` with
|
|
280
|
+
`{"error":"<diagnostic>"}` and no `root` or `tables`. Fix the config and
|
|
281
|
+
restart the server. Without `--frontend`, the `/` and `/frontend/state`
|
|
282
|
+
routes return `404`. `POST /query` is unchanged.
|
|
255
283
|
|
|
256
284
|
### Flags
|
|
257
285
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.120",
|
|
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.120",
|
|
225
|
+
"@dirsql/lib-linux-arm64-gnu": "0.4.120",
|
|
226
|
+
"@dirsql/lib-darwin-x64": "0.4.120",
|
|
227
|
+
"@dirsql/lib-darwin-arm64": "0.4.120",
|
|
228
|
+
"@dirsql/lib-win32-x64-msvc": "0.4.120"
|
|
229
229
|
}
|
|
230
230
|
}
|