dirsql 0.3.3 → 0.3.4

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/guide/cli.md CHANGED
@@ -32,6 +32,13 @@ dirsql
32
32
  The `cli` feature is **opt-in**. Adding `dirsql` as a library dependency (`cargo add dirsql`) pulls no CLI dependencies — only the core library. See the [Rust library README](https://github.com/thekevinscott/dirsql/tree/main/packages/rust) for details.
33
33
  :::
34
34
 
35
+ ## Subcommands
36
+
37
+ | Command | Purpose |
38
+ |---|---|
39
+ | `dirsql` (no subcommand) | Start the long-lived HTTP server (default behavior, see below). |
40
+ | `dirsql init` | Generate a starter `.dirsql.toml` from the contents of a directory. See [Generating a Config](./init.md). |
41
+
35
42
  ## Running the server
36
43
 
37
44
  Run `dirsql` from the directory containing your files:
@@ -0,0 +1,84 @@
1
+ ---
2
+ canonical: https://thekevinscott.github.io/dirsql/guide/init
3
+ ---
4
+
5
+ # Generating a config with `dirsql init`
6
+
7
+ > Online: <https://thekevinscott.github.io/dirsql/guide/init>
8
+
9
+ `dirsql init` generates a `.dirsql.toml` by running `claude` over the target directory.
10
+
11
+ The output is limited to filesystem-fact tables. For content-aware schemas, see [Defining Tables](./tables.md).
12
+
13
+ ## Examples
14
+
15
+ ### Mixed files
16
+
17
+ ```
18
+ my-downloads/
19
+ ├── archive.zip
20
+ ├── invoice.pdf
21
+ ├── notes.txt
22
+ └── photo.jpg
23
+ ```
24
+
25
+ ```toml
26
+ [[table]]
27
+ ddl = "CREATE TABLE files (_path TEXT, _ext TEXT, _size INTEGER)"
28
+ glob = "*"
29
+ ```
30
+
31
+ ### Path captures
32
+
33
+ ```
34
+ photos/
35
+ ├── 2024-01/
36
+ │ ├── beach.jpg
37
+ │ └── sunset.jpg
38
+ └── 2024-02/
39
+ ├── snow.jpg
40
+ └── mountain.jpg
41
+ ```
42
+
43
+ ```toml
44
+ [[table]]
45
+ ddl = "CREATE TABLE photos (month TEXT, _basename TEXT, _mtime INTEGER)"
46
+ glob = "{month}/*.jpg"
47
+ ```
48
+
49
+ ### Multiple tables
50
+
51
+ ```
52
+ my-blog/
53
+ ├── posts/
54
+ │ ├── hello-world.md
55
+ │ └── second.md
56
+ └── _comments/
57
+ └── hello-world/
58
+ ├── 2024-01-15.jsonl
59
+ └── 2024-02-03.jsonl
60
+ ```
61
+
62
+ ```toml
63
+ [[table]]
64
+ ddl = "CREATE TABLE posts (_basename TEXT, _mtime INTEGER, _size INTEGER)"
65
+ glob = "posts/*.md"
66
+
67
+ [[table]]
68
+ ddl = "CREATE TABLE comments (thread_id TEXT, _basename TEXT, _mtime INTEGER)"
69
+ glob = "_comments/{thread_id}/*.jsonl"
70
+ ```
71
+
72
+ `init` will not overwrite an existing config without `--force`.
73
+
74
+ ## Flags
75
+
76
+ | Flag | Default | Description |
77
+ |---|---|---|
78
+ | `--root <path>` | cwd | Directory to scan |
79
+ | `--output <path>` | `<root>/.dirsql.toml` | Output path |
80
+ | `--force` | off | Overwrite if the output exists |
81
+
82
+ ## Authentication
83
+
84
+ Requires `claude` on `PATH` and signed in. There is no separate API key. If `claude` is missing, `dirsql init` raises an exception.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Ephemeral SQL index over a local directory",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/thekevinscott/dirsql",
@@ -175,15 +175,15 @@
175
175
  ]
176
176
  },
177
177
  "optionalDependencies": {
178
- "@dirsql/lib-linux-x64-gnu": "0.3.3",
179
- "@dirsql/lib-linux-arm64-gnu": "0.3.3",
180
- "@dirsql/lib-darwin-x64": "0.3.3",
181
- "@dirsql/lib-darwin-arm64": "0.3.3",
182
- "@dirsql/lib-win32-x64-msvc": "0.3.3",
183
- "@dirsql/cli-linux-x64-gnu": "0.3.3",
184
- "@dirsql/cli-linux-arm64-gnu": "0.3.3",
185
- "@dirsql/cli-darwin-x64": "0.3.3",
186
- "@dirsql/cli-darwin-arm64": "0.3.3",
187
- "@dirsql/cli-win32-x64-msvc": "0.3.3"
178
+ "@dirsql/lib-linux-x64-gnu": "0.3.4",
179
+ "@dirsql/lib-linux-arm64-gnu": "0.3.4",
180
+ "@dirsql/lib-darwin-x64": "0.3.4",
181
+ "@dirsql/lib-darwin-arm64": "0.3.4",
182
+ "@dirsql/lib-win32-x64-msvc": "0.3.4",
183
+ "@dirsql/cli-linux-x64-gnu": "0.3.4",
184
+ "@dirsql/cli-linux-arm64-gnu": "0.3.4",
185
+ "@dirsql/cli-darwin-x64": "0.3.4",
186
+ "@dirsql/cli-darwin-arm64": "0.3.4",
187
+ "@dirsql/cli-win32-x64-msvc": "0.3.4"
188
188
  }
189
189
  }