dirsql 0.4.106 → 0.4.108

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.
@@ -65,7 +65,7 @@ why indexes belong to only one of them, are in
65
65
  `config` nor `tables` and call `query("SELECT * FROM './'")`
66
66
  ([SDK reference](../reference/sdk.md)).
67
67
  - Paths outside the root resolve too — `'/var/log/*.log'`, `'../notes'`,
68
- `'~/notes/*.md'` — reporting absolute paths
68
+ `'~/notes/*.md'` — reporting paths as you wrote them
69
69
  ([path-tables reference](../reference/path-tables.md#paths-outside-the-index-root)).
70
70
  - `.git/` is skipped by default, and a git repo's `.gitignore` hides what it
71
71
  lists, so a bare `'./**'` does not drown in machinery
@@ -31,7 +31,7 @@ lazily-read hidden [`content`](./path-tables.md#columns) column.
31
31
 
32
32
  | Column | Type | Value |
33
33
  |---|---|---|
34
- | `path` | TEXT | The file's path relative to the scan root (e.g. `posts/hello.md`); absolute for a `/`, `../` or `~/` path-table. |
34
+ | `path` | TEXT | The file's path relative to the scan root (e.g. `posts/hello.md`); as written for a `../` path-table, absolute for a `/` or `~/` one. |
35
35
  | `basename` | TEXT | The filename, including extension (`hello.md`). |
36
36
  | `dir` | TEXT | The parent directory relative to the root (`posts`); the empty string for files directly under the root. |
37
37
  | `ext` | TEXT | The file extension without the leading dot (`md`). Original case is preserved — `Photo.JPG` yields `JPG`; use `LOWER(ext)` for case-insensitive matching. `NULL` when the file has no extension. |
@@ -19,7 +19,7 @@ divergence is a written decision.
19
19
  ## The fixture
20
20
 
21
21
  Every example below runs against this tree. A name ending in `/` is an empty
22
- directory, `a -> b` is a symlink, and `.gitignore` holds `*.log`.
22
+ directory, `a -> b` is a symlink, and `.gitignore` holds `*.log` and `dist/`.
23
23
 
24
24
  <!-- conformance-tree -->
25
25
  ```text
@@ -48,6 +48,8 @@ docs/.draft.md
48
48
  docs/nested/deep.md
49
49
  docs/nested/.cache/x.md
50
50
  node_modules/pkg/index.js
51
+ dist/bundle.js
52
+ dist/sub/o.js
51
53
  real/r.md
52
54
  uni/1.md
53
55
  uni/a.md
@@ -126,13 +128,22 @@ A test runs every row against dirsql as a path-table and, with the leading
126
128
  | `./*.log` | none | gitignore |
127
129
  | `./ignored.log` | `ignored.log` | |
128
130
  | `./{ignored,x}.log` | `ignored.log` | |
131
+ | `./dist/*.js` | none | gitignore |
132
+ | `./dist/**/*.js` | none | gitignore |
133
+ | `./dist/sub/*.js` | none | gitignore |
134
+ | `./d*/*.js` | none | gitignore |
135
+ | `./dist/bundle.js` | `dist/bundle.js` | |
136
+ | `./dist/sub/o.js` | `dist/sub/o.js` | |
129
137
  | `./**/*.js` | `node_modules/pkg/index.js` | |
130
138
  | `./node_modules/*/index.js` | `node_modules/pkg/index.js` | |
131
139
  | `./docs/**/*.md` | `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md` | |
132
140
  | `./docs/*.md` | `docs/api.md`, `docs/guide.md` | |
133
- | `$ROOT/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | absolute |
134
- | `~/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | absolute |
135
- | `../proj/docs/*.md` | `$BASE/proj/docs/api.md`, `$BASE/proj/docs/guide.md` | absolute |
141
+ | `$ROOT/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | |
142
+ | `~/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | |
143
+ | `../proj/docs/*.md` | `../proj/docs/api.md`, `../proj/docs/guide.md` | |
144
+ | `../*/top.md` | `../proj/top.md` | |
145
+ | `../proj/**/deep.md` | `../proj/docs/nested/deep.md` | |
146
+ | `../proj/docs` | `../proj/docs/api.md`, `../proj/docs/guide.md` | directory-name |
136
147
 
137
148
  ## Divergences from bash
138
149
 
@@ -141,10 +152,17 @@ A test runs every row against dirsql as a path-table and, with the leading
141
152
  | `gitignore` | Inside a git repo, `.gitignore` files hide files and directories a wildcard matches, never one the pattern spells out. `--no-ignore` turns it off. | A query over a repo should not drown in build output. |
142
153
  | `directory-name` | A pattern's last component that names a directory lists the files directly inside it, like `ls docs`. A trailing `/` is `*` appended. | A table is rows of files, and `ls` is the shell habit. |
143
154
  | `files-only` | A pattern that matches a directory but no file returns nothing. | Every row is a file. |
144
- | `absolute` | `/`, `~/` and `../` patterns report absolute `path` values, with `..` folded out textually. | The scanned root is derived from the pattern, so there is no relative base. |
145
155
 
146
156
  `.git` needs no rule of its own: the dotfile rule hides it.
147
157
 
158
+ ## Syntax, not behavior
159
+
160
+ A path-table starts with `./`, `/`, `~/` or `../`. That is how `FROM` tells a
161
+ path from a table name, so `FROM './**/*.md'` is a glob and `FROM docs` is a
162
+ table. A config `glob` has no such need and is written without the `./`.
163
+ Bash accepts a bare `**/*.md`; dirsql does not in a path-table. This is syntax,
164
+ not a divergence: past the prefix, the glob behaves as bash does.
165
+
148
166
  ## Where the glob is anchored
149
167
 
150
168
  A path-table pattern is relative to the index root and starts with `./`. A config `[[table]] glob`
@@ -109,19 +109,15 @@ Three other prefixes resolve, with their usual shell meanings:
109
109
  | You write | dirsql scans |
110
110
  | --- | --- |
111
111
  | `'/var/log/*.log'` | an absolute path |
112
- | `'../notes'` | relative to the index root's parent |
112
+ | `'../notes'` | relative to the index root's parent, as written |
113
113
  | `'~/notes/*.md'` | relative to your home directory |
114
114
 
115
115
  A directory named this way is one level too; `'../notes/**'` descends. The
116
116
  trailing-`/` rule holds here as well: `'~/*/'` is `'~/*/*'`.
117
- `..` is folded out textually, not followed through symlinks, so the directory
118
- scanned is a function of the string you wrote.
119
-
120
- **These report absolute `path` values.** A `./` path-table reports paths
121
- relative to the index root, matching every other dirsql table; a `/`, `../` or
122
- `~/` path-table has no meaningful relative base — the root it scans is derived
123
- from the pattern, not named by you — so it reports the full path instead. The
124
- value you get back is one you can paste into another command:
117
+ **A `../` path-table reports `path` as written**, relative to the directory
118
+ dirsql runs in, as bash prints it: `'../notes/*.md'` gives `../notes/a.md`. A
119
+ `/` or `~/` path-table is absolute already, so it reports the full path. Either
120
+ value is one you can paste into another command:
125
121
 
126
122
  ```sql
127
123
  SELECT path FROM '/var/log/*.log';
@@ -144,7 +140,7 @@ table:
144
140
 
145
141
  | Column | Type | Meaning |
146
142
  | --- | --- | --- |
147
- | `path` | TEXT | path relative to the index root (absolute for `/`, `../`, `~/` tables) |
143
+ | `path` | TEXT | path relative to the index root (as written for `../` tables, absolute for `/` and `~/` tables) |
148
144
  | `basename` | TEXT | filename with extension |
149
145
  | `dir` | TEXT | parent directory, relative to the index root |
150
146
  | `ext` | TEXT | extension without the dot |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.4.106",
3
+ "version": "0.4.108",
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.106",
225
- "@dirsql/lib-linux-arm64-gnu": "0.4.106",
226
- "@dirsql/lib-darwin-x64": "0.4.106",
227
- "@dirsql/lib-darwin-arm64": "0.4.106",
228
- "@dirsql/lib-win32-x64-msvc": "0.4.106"
224
+ "@dirsql/lib-linux-x64-gnu": "0.4.108",
225
+ "@dirsql/lib-linux-arm64-gnu": "0.4.108",
226
+ "@dirsql/lib-darwin-x64": "0.4.108",
227
+ "@dirsql/lib-darwin-arm64": "0.4.108",
228
+ "@dirsql/lib-win32-x64-msvc": "0.4.108"
229
229
  }
230
230
  }