dirsql 0.4.105 → 0.4.107
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
|
|
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
|
|
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. |
|
package/docs/reference/glob.md
CHANGED
|
@@ -49,6 +49,13 @@ docs/nested/deep.md
|
|
|
49
49
|
docs/nested/.cache/x.md
|
|
50
50
|
node_modules/pkg/index.js
|
|
51
51
|
real/r.md
|
|
52
|
+
uni/1.md
|
|
53
|
+
uni/a.md
|
|
54
|
+
uni/é.md
|
|
55
|
+
uni/É.md
|
|
56
|
+
uni/中.md
|
|
57
|
+
uni/٣.md
|
|
58
|
+
uni/¡.md
|
|
52
59
|
linkdir -> real
|
|
53
60
|
link.md -> top.md
|
|
54
61
|
broken -> nowhere
|
|
@@ -69,13 +76,21 @@ A test runs every row against dirsql as a path-table and, with the leading
|
|
|
69
76
|
| Pattern | Rows | Divergence |
|
|
70
77
|
| --- | --- | --- |
|
|
71
78
|
| `./*.md` | `1.md`, `2.md`, `3.md`, `4.md`, `[a].md`, `[z.md`, `a.md`, `b.md`, `c.md`, `link.md`, `my file.md`, `top.md`, `{q}.md` | |
|
|
72
|
-
| `./**/*.md` | `1.md`, `2.md`, `3.md`, `4.md`, `[a].md`, `[z.md`, `a.md`, `b.md`, `c.md`, `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md`, `link.md`, `linkdir/r.md`, `my file.md`, `real/r.md`, `top.md`, `{q}.md` | |
|
|
73
|
-
| `./**` | `1.md`, `2.md`, `3.md`, `4.md`, `[a].md`, `[z.md`, `a.md`, `b.md`, `c.md`, `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md`, `link.md`, `my file.md`, `node_modules/pkg/index.js`, `real/r.md`, `top.md`, `x.txt`, `{q}.md` | |
|
|
79
|
+
| `./**/*.md` | `1.md`, `2.md`, `3.md`, `4.md`, `[a].md`, `[z.md`, `a.md`, `b.md`, `c.md`, `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md`, `link.md`, `linkdir/r.md`, `my file.md`, `real/r.md`, `top.md`, `uni/1.md`, `uni/a.md`, `uni/¡.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md`, `{q}.md` | |
|
|
80
|
+
| `./**` | `1.md`, `2.md`, `3.md`, `4.md`, `[a].md`, `[z.md`, `a.md`, `b.md`, `c.md`, `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md`, `link.md`, `my file.md`, `node_modules/pkg/index.js`, `real/r.md`, `top.md`, `uni/1.md`, `uni/a.md`, `uni/¡.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md`, `x.txt`, `{q}.md` | |
|
|
74
81
|
| `./?.md` | `1.md`, `2.md`, `3.md`, `4.md`, `a.md`, `b.md`, `c.md` | |
|
|
75
82
|
| `./[ab].md` | `a.md`, `b.md` | |
|
|
76
83
|
| `./[!a].md` | `1.md`, `2.md`, `3.md`, `4.md`, `b.md`, `c.md` | |
|
|
77
84
|
| `./\[a\].md` | `[a].md` | |
|
|
78
85
|
| `./[z.md` | `[z.md` | |
|
|
86
|
+
| `./uni/[[:alpha:]].md` | `uni/a.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md` | |
|
|
87
|
+
| `./uni/[[:alnum:]].md` | `uni/1.md`, `uni/a.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md` | |
|
|
88
|
+
| `./uni/[[:lower:]].md` | `uni/a.md`, `uni/é.md` | |
|
|
89
|
+
| `./uni/[[:upper:]].md` | `uni/É.md` | |
|
|
90
|
+
| `./uni/[[:digit:]].md` | `uni/1.md` | |
|
|
91
|
+
| `./uni/[[:punct:]].md` | `uni/¡.md` | |
|
|
92
|
+
| `./uni/[[:word:]].md` | `uni/1.md`, `uni/a.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md` | |
|
|
93
|
+
| `./uni/[![:alpha:]].md` | `uni/1.md`, `uni/¡.md` | |
|
|
79
94
|
| `./[d/x]ocs/api.md` | none | |
|
|
80
95
|
| `./docs[/]api.md` | none | |
|
|
81
96
|
| `./[!/]*/api.md` | none | |
|
|
@@ -106,7 +121,7 @@ A test runs every row against dirsql as a path-table and, with the leading
|
|
|
106
121
|
| `./docs/*/../api.md` | `docs/nested/../api.md` | |
|
|
107
122
|
| `./docs` | `docs/api.md`, `docs/guide.md` | directory-name |
|
|
108
123
|
| `./docs/` | `docs/api.md`, `docs/guide.md` | directory-name |
|
|
109
|
-
| `./*/` | `docs/api.md`, `docs/guide.md`, `linkdir/r.md`, `real/r.md` | directory-name |
|
|
124
|
+
| `./*/` | `docs/api.md`, `docs/guide.md`, `linkdir/r.md`, `real/r.md`, `uni/1.md`, `uni/a.md`, `uni/¡.md`, `uni/É.md`, `uni/é.md`, `uni/٣.md`, `uni/中.md` | directory-name |
|
|
110
125
|
| `./d*` | none | files-only |
|
|
111
126
|
| `./*.log` | none | gitignore |
|
|
112
127
|
| `./ignored.log` | `ignored.log` | |
|
|
@@ -115,9 +130,12 @@ A test runs every row against dirsql as a path-table and, with the leading
|
|
|
115
130
|
| `./node_modules/*/index.js` | `node_modules/pkg/index.js` | |
|
|
116
131
|
| `./docs/**/*.md` | `docs/api.md`, `docs/guide.md`, `docs/nested/deep.md` | |
|
|
117
132
|
| `./docs/*.md` | `docs/api.md`, `docs/guide.md` | |
|
|
118
|
-
| `$ROOT/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` |
|
|
119
|
-
| `~/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` |
|
|
120
|
-
| `../proj/docs/*.md` |
|
|
133
|
+
| `$ROOT/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | |
|
|
134
|
+
| `~/docs/*.md` | `$ROOT/docs/api.md`, `$ROOT/docs/guide.md` | |
|
|
135
|
+
| `../proj/docs/*.md` | `../proj/docs/api.md`, `../proj/docs/guide.md` | |
|
|
136
|
+
| `../*/top.md` | `../proj/top.md` | |
|
|
137
|
+
| `../proj/**/deep.md` | `../proj/docs/nested/deep.md` | |
|
|
138
|
+
| `../proj/docs` | `../proj/docs/api.md`, `../proj/docs/guide.md` | directory-name |
|
|
121
139
|
|
|
122
140
|
## Divergences from bash
|
|
123
141
|
|
|
@@ -126,10 +144,17 @@ A test runs every row against dirsql as a path-table and, with the leading
|
|
|
126
144
|
| `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. |
|
|
127
145
|
| `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. |
|
|
128
146
|
| `files-only` | A pattern that matches a directory but no file returns nothing. | Every row is a file. |
|
|
129
|
-
| `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. |
|
|
130
147
|
|
|
131
148
|
`.git` needs no rule of its own: the dotfile rule hides it.
|
|
132
149
|
|
|
150
|
+
## Syntax, not behavior
|
|
151
|
+
|
|
152
|
+
A path-table starts with `./`, `/`, `~/` or `../`. That is how `FROM` tells a
|
|
153
|
+
path from a table name, so `FROM './**/*.md'` is a glob and `FROM docs` is a
|
|
154
|
+
table. A config `glob` has no such need and is written without the `./`.
|
|
155
|
+
Bash accepts a bare `**/*.md`; dirsql does not in a path-table. This is syntax,
|
|
156
|
+
not a divergence: past the prefix, the glob behaves as bash does.
|
|
157
|
+
|
|
133
158
|
## Where the glob is anchored
|
|
134
159
|
|
|
135
160
|
A path-table pattern is relative to the index root and starts with `./`. A config `[[table]] glob`
|
|
@@ -146,6 +171,9 @@ stderr; the exit code is unchanged. Path-tables never warn.
|
|
|
146
171
|
`{a..c}` expand, as do zero-padded
|
|
147
172
|
`{01..10}` and stepped `{1..10..2}` ranges. Groups nest.
|
|
148
173
|
- `\[` is a literal bracket.
|
|
174
|
+
- POSIX classes (`[[:alpha:]]`) match Unicode characters, as bash does in a UTF-8
|
|
175
|
+
locale: `[[:alpha:]]` matches `é` and `中`. `[[:digit:]]`, `[[:xdigit:]]` and
|
|
176
|
+
`[[:ascii:]]` stay ASCII.
|
|
149
177
|
- A dot-named file or directory is listed only where a component spells the
|
|
150
178
|
dot at that depth: `./**/.*` finds `docs/.draft.md` but does not enter
|
|
151
179
|
`.config/`.
|
|
@@ -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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.4.107",
|
|
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.107",
|
|
225
|
+
"@dirsql/lib-linux-arm64-gnu": "0.4.107",
|
|
226
|
+
"@dirsql/lib-darwin-x64": "0.4.107",
|
|
227
|
+
"@dirsql/lib-darwin-arm64": "0.4.107",
|
|
228
|
+
"@dirsql/lib-win32-x64-msvc": "0.4.107"
|
|
229
229
|
}
|
|
230
230
|
}
|