@nongt/visql 0.6.1 → 0.8.0

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/README.md CHANGED
@@ -152,6 +152,13 @@ back by that key, and outside the sub query that column is join-only too.
152
152
  `validateQuery` reports a key used anywhere else as `joinOnlyColumn`, an
153
153
  error, so your server refuses what the editor wouldn't offer.
154
154
 
155
+ A large catalog is easier to pick from in groups. Give a table a `group`
156
+ (its business area, say) and a `description`, and the table pickers list
157
+ the tables under a heading per group, with the description under each
158
+ label. You can also draw the options yourself, add your own button beside
159
+ each picker, or replace the picker with your own.
160
+ [Helping users find a table](docs/table-pickers.md) has the details.
161
+
155
162
  Relations also tell the editor which side of a join has many rows. Joining
156
163
  `orders` to `order_items` repeats each order once per item, so a SUM of the
157
164
  order totals comes out too high without any error. The editor warns about
@@ -223,7 +230,8 @@ await pg.query(sql, params);
223
230
 
224
231
  Every value becomes a parameter, wherever it is: `?` in MySQL, `$1` in
225
232
  PostgreSQL, `@p1` in SQL Server. Names are quoted. Function names and other
226
- parts that can't be parameters are checked against plain patterns. Dates
233
+ parts that can't be parameters are checked against plain patterns, and an
234
+ operator the library doesn't know throws an error instead of being written. Dates
227
235
  are sent as text, because drivers would otherwise shift a `Date` into the
228
236
  server's time zone.
229
237
 
@@ -285,7 +293,7 @@ writing the SQL, and the contract fixtures to run in CI.
285
293
  | `schema` | `DatabaseSchema` | **Required.** Tables, columns and relations. |
286
294
  | `value` / `defaultValue` | `QueryValue \| null` | The query, controlled or uncontrolled. |
287
295
  | `onChange` | `(query: QueryValue) => void` | Called on every edit, undo and redo. |
288
- | `ref` | `Ref<QueryBuilderHandle>` | `resetHistory()`, `goToIssue(issue)` to take the user to a problem, and `run()`. |
296
+ | `ref` | `Ref<QueryBuilderHandle>` | `resetHistory()`, `goToIssue(issue)` to take the user to a problem, `run()`, and `addTable(name, { as })` to add a table from your own page. |
289
297
  | `readOnly` | `boolean` | Look around the query without changing it. |
290
298
  | `tableFilter` | `(table) => boolean` | Tables this user may see. They're never added automatically either. |
291
299
  | `columnFilter` | `(table, column) => boolean` | Columns this user may see. |
@@ -415,6 +423,9 @@ types work with TypeScript's older `moduleResolution: "node"` as well as
415
423
  query.
416
424
  - [Showing the SQL and problems](docs/sql-preview.md): a SQL view linked to
417
425
  the editor both ways, and a problems list of your own.
426
+ - [Helping users find a table](docs/table-pickers.md): grouping the table
427
+ pickers, a description for each table, your own options, buttons or
428
+ picker, and adding a table from your own page.
418
429
  - [UI adapters](docs/ui-adapters.md): using a component library other than
419
430
  MUI.
420
431
  - [`docs/design/`](docs/design): why some things work the way they do.