dirsql 0.4.144 → 0.4.146

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.
@@ -128,6 +128,11 @@ several lines, and **anything longer than 60 characters is truncated with
128
128
  `…`** so one column cannot set the width of every row. `--format json`
129
129
  returns the values unaltered.
130
130
 
131
+ A text value that is not valid UTF-8 (`CAST(x'ff' AS TEXT)`, `char(55296)`)
132
+ fails the query in every format, with an error naming its column, rather
133
+ than printing replacement characters. Wrap it in `hex()` or `CAST(… AS BLOB)`
134
+ to read its bytes.
135
+
131
136
  Laying the table out to the terminal's width, and paging a long result, are
132
137
  both out of scope; pipe to `less` for the latter.
133
138
 
@@ -224,10 +224,10 @@ what its required `on-file` command emits — dirsql injects nothing (see
224
224
  | Key | Required | Description |
225
225
  |---|---|---|
226
226
  | `name` | yes | The table's SQL name — the name you query it by. Declared, never derived from `ddl`: dirsql does not read the DDL text. The `ddl` must create a table by this name; if it doesn't, loading fails. |
227
- | `ddl` | yes | A SQL batch, run verbatim — any number of statements. It must create a table called `name`; that table holds the file rows, and only the columns it declares are kept (keys the `on-file` command emits that are not declared are dropped). The rest of the batch is yours: indexes, virtual tables, triggers. See [Batch `ddl`](#batch-ddl). |
227
+ | `ddl` | yes | A SQL batch, run verbatim — any number of statements. It must create a table called `name`; that table holds the file rows, and only the columns it declares are kept (a key the `on-file` command emits fills the declared column it names, compared case-insensitively for ASCII letters as SQL identifiers are; a key naming no declared column is dropped). The rest of the batch is yours: indexes, virtual tables, triggers. See [Batch `ddl`](#batch-ddl). |
228
228
  | `glob` | yes | Glob pattern, [anchored](#glob-anchor) at the config file's directory, under the [one glob rule](#glob-rule): `*` matches one level, `**` any depth. Every table whose glob matches a file receives that file's rows — a file can populate multiple tables. A `{name}` is a literal, as in bash and a path-table; the [glob page](./glob.md) has the syntax. |
229
229
  | `on-file` | **yes** | A command run once per table, with every matched file's absolute path appended as a trailing argument; its stdout (one JSON object per line) is the table's rows. Must be non-empty. A `[[table]]` with no `on-file` is a load error (see [parse errors](#parse-errors)). See [Command hooks](./hooks.md#on-file). |
230
- | `strict` | no (default `false`) | When `true`, rows whose keys do not exactly match the declared columns are rejected with an error: extra keys error, and every declared column must be supplied by the `on-file` output. When `false`, extra keys are dropped and missing columns become `NULL`. |
230
+ | `strict` | no (default `false`) | When `true`, rows whose keys do not match the declared columns (compared case-insensitively, as above) are rejected with an error: extra keys error, and every declared column must be supplied by the `on-file` output. When `false`, extra keys are dropped and missing columns become `NULL`. |
231
231
 
232
232
  `on-file` is required because a table's rows come from nowhere else. dirsql
233
233
  does not read file contents or merge filesystem facts on your behalf: the
@@ -223,7 +223,9 @@ db.query_with(sql: &str, params: &Params) -> Result<Vec<Row>>
223
223
 
224
224
  :::
225
225
 
226
- Executes a SQL query and returns rows keyed by column name.
226
+ Executes a SQL query and returns rows keyed by column name. If a result repeats
227
+ a column name, later occurrences receive `:N` suffixes (for example, `a` and
228
+ `a:1`); suffixes avoid names already present in the result.
227
229
 
228
230
  **Bind parameters.** `params` reaches SQLite's own parameter binding; the
229
231
  values never enter the SQL text, so text holding quotes needs no escaping.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dirsql",
3
- "version": "0.4.144",
3
+ "version": "0.4.146",
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.144",
225
- "@dirsql/lib-linux-arm64-gnu": "0.4.144",
226
- "@dirsql/lib-darwin-x64": "0.4.144",
227
- "@dirsql/lib-darwin-arm64": "0.4.144",
228
- "@dirsql/lib-win32-x64-msvc": "0.4.144"
224
+ "@dirsql/lib-linux-x64-gnu": "0.4.146",
225
+ "@dirsql/lib-linux-arm64-gnu": "0.4.146",
226
+ "@dirsql/lib-darwin-x64": "0.4.146",
227
+ "@dirsql/lib-darwin-arm64": "0.4.146",
228
+ "@dirsql/lib-win32-x64-msvc": "0.4.146"
229
229
  }
230
230
  }