Repository navigation
Expand file tree
/
Copy pathtablepro.1
More file actions
345 lines (345 loc) · 9.71 KB
/
Copy pathtablepro.1
File metadata and controls
345 lines (345 loc) · 9.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
.TH TABLEPRO 1 2026-11-16 "TablePro 0.1.0-beta.4" "User Commands"
.SH NAME
tablepro \- open databases and query saved connections from a shell
.SH SYNOPSIS
.SY tablepro
.OP \-n
.RI [ FILE " | " URL " ...]"
.YS
.SY "tablepro open"
.OP \-n
.RI [ FILE " | " URL " ...]"
.YS
.SY "tablepro query"
.BI \-c " CONNECTION"
.OP \-\-database NAME
.OP \-\-format FORMAT
.OP \-\-limit ROWS
.OP \-\-timeout SECONDS
.OP \-\-read\-only
.RI [ SQL " |"
.BI \-f " FILE"
.RB ]
.YS
.SY "tablepro connections"
.OP \-\-format FORMAT
.YS
.SY "tablepro databases"
.BI \-c " CONNECTION"
.OP \-\-format FORMAT
.YS
.SY "tablepro schemas"
.BI \-c " CONNECTION"
.OP \-\-database NAME
.OP \-\-format FORMAT
.YS
.SY "tablepro tables"
.BI \-c " CONNECTION"
.OP \-\-database NAME
.OP \-\-schema NAME
.OP \-\-format FORMAT
.YS
.SY "tablepro describe"
.BI \-c " CONNECTION"
.OP \-\-database NAME
.OP \-\-schema NAME
.RB [ \-\-ddl " | " \-\-format " FORMAT ]"
.I TABLE
.YS
.SY "tablepro export"
.BI \-c " CONNECTION"
.BI \-\-format " FORMAT"
.OP \-\-database NAME
.OP \-\-schema NAME
.OP \-\-limit ROWS
.IR TABLE ...
.YS
.SY "tablepro status"
.OP \-\-format FORMAT
.YS
.SY "tablepro completion"
.BR bash " | " zsh " | " fish
.YS
.SY "tablepro help"
.RI [ COMMAND ]
.YS
.SY tablepro
.BR \-\-help " | " \-\-version
.YS
.SH DESCRIPTION
TablePro browses and edits PostgreSQL, MySQL, MariaDB, SQLite, DuckDB,
SQL Server, ClickHouse, Cassandra, ScyllaDB, Redis and MongoDB databases.
.PP
Run without a command to open the graphical app.
Files and connection URLs open there, in the running instance when one exists.
Queries, schema listings and exports print in the terminal.
.PP
The Linux packages install
.BR tablepro .
For Flatpak, replace it with
.B flatpak run app.tablepro.TablePro
in each invocation.
Run the command from the same installation as the app.
.SH COMMANDS
Commands that use the database require the app to be running with
.B Preferences > MCP > Enable MCP Server
on.
They read the server port from the app's settings and its token from the keyring.
They never start the app or create a token.
There is no pairing command.
.PP
A command opens a closed connection only when standard error is a terminal.
Answer any prompt in the app; the command waits up to five minutes.
For unattended scripts, open the connection first.
.TP
.B open
Open files and links, or the app with no targets.
SQL files open in an editor without running.
SQLite and DuckDB files open database sessions.
A link matching a saved connection asks before opening it;
other links fill the connect dialog and wait for Connect.
Local links also require consent.
.TP
.B query
Run one statement, or one SQL Server batch.
Read UTF-8 SQL from the argument, a file, or standard input.
With no argument or file, standard input must be a pipe or redirected file.
Use
.B \-f \-
to read from a terminal until end of file.
SQL text is limited to 100 KiB.
.TP
.B connections
List visible saved connections by name, id and type.
.TP
.B databases
List the connection's databases.
An engine without database listing returns an error.
.TP
.B schemas
List schemas, including default and system flags.
.TP
.B tables
List tables and views in a schema.
.TP
.B describe
Print columns, indexes and foreign keys as separate result sets.
Use
.B \-\-ddl
for the CREATE statements instead.
.TP
.B export
Print data from one to 20 tables or views.
Choose CSV, JSON or SQL INSERT statements with the required
.B \-\-format
option.
Names are unquoted SQL identifiers; use shell quotes for spaces and
.B \-\-schema
for the schema.
Redirect standard output to save a file.
.TP
.B status
Report the app version, running state, MCP setting and port,
token availability, server version and readiness.
Does not start the app or open a connection.
.TP
.B completion
Print a completion script for bash, zsh or fish.
The .deb and .rpm packages install these scripts; Flatpak does not.
Connection names are not looked up for completion.
.TP
.B help
Show all commands, or the options of one command.
.SH OPTIONS
Options apply to the commands shown in SYNOPSIS.
.TP
.BR \-c ", " \-\-connection " CONNECTION"
Select a saved connection by name or id.
Use an id if several connections have the same name.
.TP
.BI \-\-database " NAME"
Use a database already open beside the connection through Open Database.
The default is the connection's own database.
.TP
.BI \-\-schema " NAME"
Use a schema instead of the connection's default.
This option is not accepted by query; qualify names in the SQL instead.
.TP
.BR \-f ", " \-\-file " FILE"
Read SQL from FILE, or standard input when FILE is a single dash.
Cannot be combined with a SQL argument.
.TP
.BI \-\-format " FORMAT"
For query, listings, describe and status: csv, tsv, json, jsonl or table.
The default is table on a terminal and csv otherwise.
For export: csv, json or sql, with no default.
Format names accept any letter case.
.TP
.BI \-\-limit " ROWS"
Return 1 to 1,000 rows, with 100 as the default.
For query the limit applies per result set; for export, per table.
Truncation is reported on standard error.
The limit does not bound how many rows a write changes.
.TP
.BI \-\-timeout " SECONDS"
Allow 1 to 300 seconds for the statement, with 30 as the default.
Time spent waiting for write approval is not part of this timeout.
.TP
.B \-\-read\-only
Refuse any statement that is not a read, before asking for write approval.
.TP
.B \-\-ddl
Print CREATE statements instead of a table description.
Cannot be combined with
.BR \-\-format .
.TP
.BR \-n ", " \-\-new\-window
Open a new window, with any supplied files or URLs.
.TP
.BR \-h ", " \-\-help
Print help and exit.
.TP
.B \-\-version
Print the app version and exit.
.TP
.B \-\-help\-all
Show the GUI and GApplication options.
.TP
.B \-\-
End options.
Place SQL or file names beginning with a dash after this marker.
.SH OUTPUT
Rows go to standard output; errors, notices and truncation messages go to standard error.
CSV has a header, an empty field for NULL and two quotes for an empty string.
TSV escapes tabs, newlines, carriage returns and backslashes.
JSON is an array of objects; JSONL writes one object per line.
The table format aligns columns and displays control characters as escapes.
.PP
Several result sets become an array of arrays in JSON,
consecutive objects in JSONL, or blocks separated by a blank line otherwise.
Several JSON table exports also form an array of arrays.
.SH ACCESS
The connection's External Clients setting controls access.
Blocked connections are omitted from listings and cannot be selected.
Read Only is the default and refuses writes.
Read & Write still requires approval for every write in the connection's window.
Safe Mode Read-Only refuses writes regardless of external access.
A transaction left open by a write is rolled back when that call ends.
.SH CONNECTION URLS
The desktop registers these schemes:
postgresql, postgres, mysql, mariadb, mysqlx, sqlserver, mssql,
clickhouse, ch, cassandra, cql, scylla, scylladb, redis, rediss,
valkey, valkeys, mongodb, mongodb+srv, sqlite, sqlite3 and duckdb.
A jdbc wrapper around a supported URL also works from the command line.
.PP
A link never connects without consent.
For a saved connection, click Open; Enter and Escape cancel.
For other links, review the connect dialog and click Connect.
A successful connection from that dialog is saved.
.SH SHARE LINKS
The desktop also registers the tablepro scheme.
A link of the form tablepro://share?token=TOKEN, from a shared query's page,
opens the shared SQL in a new query tab of the connection in front.
The SQL never runs on its own, and the link names no connection.
.SH EXIT STATUS
.TP
.B 0
Success, including help, version and completion output.
A pipe closed by its reader also exits 0.
.TP
.B 1
Database, connection or output error.
Also used when the app is stopped, a script finds a closed connection,
or a connection does not open within the wait period.
.TP
.B 2
Invalid usage, SQL input or option value; unknown or ambiguous connection;
missing file.
.TP
.B 3
Access refused, MCP server disabled, token rejected, or approval declined.
.TP
.B 4
Query or server request timed out.
.SH FILES
.TP
.I $XDG_CONFIG_HOME/tablepro/connections.json
Saved connections. Passwords and the MCP token live in the keyring.
.TP
.I $XDG_CONFIG_HOME/tablepro/column_layouts.json
Column layout settings.
.TP
.I $XDG_CONFIG_HOME/tablepro/filter_settings.json
Saved table filters.
.TP
.I $XDG_STATE_HOME/tablepro/history.db
Query history and saved queries.
.TP
.I $XDG_STATE_HOME/tablepro/workspaces/
Saved tabs and open connections.
.TP
.I $XDG_DATA_HOME/tablepro/drafts/
SQL editor drafts.
.TP
.I $XDG_STATE_HOME/tablepro/crashes/
Crash reports from the graphical app.
.PP
Preferences use the GSettings schema
.BR app.tablepro.TablePro .
Flatpak uses its own settings and keyring storage.
.SH ENVIRONMENT
.TP
.BR XDG_CONFIG_HOME ", " XDG_STATE_HOME ", " XDG_DATA_HOME
Base directories for application files.
Defaults are
.IR ~/.config ,
.I ~/.local/state
and
.IR ~/.local/share ,
respectively.
.TP
.B RUST_LOG
Log filter for the graphical app, such as
.BR tablepro=debug .
Does not control query output.
.TP
.B TABLEPRO_LOG_FORMAT
Graphical app log format: text by default, or json.
.SH EXAMPLES
Open a database file:
.PP
.EX
tablepro app.sqlite3
.EE
.PP
Open a file named like a command:
.PP
.EX
tablepro open ./query
.EE
.PP
List connections and run a report:
.PP
.EX
tablepro connections \-\-format json
tablepro query \-c Staging \-f report.sql \-\-format csv > report.csv
.EE
.PP
Read SQL from standard input under Flatpak:
.PP
.EX
flatpak run app.tablepro.TablePro query \-c Staging < report.sql
.EE
.PP
Inspect and export a table:
.PP
.EX
tablepro describe \-c Staging \-\-schema public \-\-ddl orders
tablepro export \-c Staging \-\-format sql \-\-limit 1000 orders > orders.sql
.EE
.SH SEE ALSO
.BR flatpak (1),
.BR gsettings (1),
.BR ssh (1)
.PP
https://docs.tablepro.app/linux/command-line