Cut long values in SQL result tables to fit the terminal

One long value made every line of the table wider than the terminal,
so the whole table wrapped. Narrow the widest columns until the table
fits and end cut values with an ellipsis. Adding --full to the query,
which is an SQL comment, shows the values in full as before.
This commit is contained in:
2026-09-30 17:26:16 +02:00
parent 6dbf2f9675
commit ec4b4a4ece
2 changed files with 40 additions and 6 deletions
+4
View File
@@ -85,6 +85,10 @@ run the whole block in a single request — this matters for scripts like
statement in one submission runs on the same database connection/session.
Type `occ` to switch back to the normal occ-command mode.
Long values in result tables are cut to fit the terminal. Add `--full` to the
query (it is an SQL comment, so the database ignores it) to see them in full,
e.g. `SELECT configvalue FROM oc_appconfig WHERE configkey = 'x'; --full`.
Every statement that changes data or the schema (`DELETE`, `UPDATE`,
`INSERT`, `DROP`, a data-modifying `WITH`, ...) asks for confirmation before
the batch runs. There is still no undo — double check what you are about to