sqlite-hub 0.17.2 → 1.1.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 +143 -47
- package/bin/sqlite-hub.js +206 -444
- package/examples/api/queries.js +31 -0
- package/examples/api/rows.js +27 -0
- package/frontend/assets/mockups/charts_1_bars_1200.webp +0 -0
- package/frontend/assets/mockups/charts_2_pie_1200.webp +0 -0
- package/frontend/assets/mockups/charts_3_scatter_plot_1200.webp +0 -0
- package/frontend/assets/mockups/connections_1200.webp +0 -0
- package/frontend/assets/mockups/data_1_1200.webp +0 -0
- package/frontend/assets/mockups/data_2_row_editor_1200.webp +0 -0
- package/frontend/assets/mockups/documents_1200.webp +0 -0
- package/frontend/assets/mockups/media_tagging_1_setup_1200.webp +0 -0
- package/frontend/assets/mockups/media_tagging_2_tagging_queue_1200.webp +0 -0
- package/frontend/assets/mockups/media_tagging_3_media_viewer_1200.webp +0 -0
- package/frontend/assets/mockups/overview_1200.webp +0 -0
- package/frontend/assets/mockups/settings_1200.webp +0 -0
- package/frontend/assets/mockups/sql_editor_1_1200.webp +0 -0
- package/frontend/assets/mockups/sql_editor_2_query_details_1200.webp +0 -0
- package/frontend/assets/mockups/sql_editor_3_export_column_1200.webp +0 -0
- package/frontend/assets/mockups/sql_editor_4_export_column_as_markdown_1200.webp +0 -0
- package/frontend/assets/mockups/sql_editor_5_export_query_result_1200.webp +0 -0
- package/frontend/assets/mockups/structure_1_1200.webp +0 -0
- package/frontend/assets/mockups/structure_2_inspector_1200.webp +0 -0
- package/frontend/assets/mockups/table_designer_1_1200.webp +0 -0
- package/frontend/assets/mockups/table_designer_2_checks_1200.webp +0 -0
- package/frontend/js/api.js +25 -0
- package/frontend/js/app.js +263 -34
- package/frontend/js/components/formControls.js +38 -0
- package/frontend/js/components/modal.js +77 -21
- package/frontend/js/components/queryChartRenderer.js +28 -3
- package/frontend/js/components/queryEditor.js +20 -24
- package/frontend/js/components/queryHistoryDetail.js +1 -1
- package/frontend/js/components/queryHistoryHeader.js +48 -0
- package/frontend/js/components/queryHistoryList.js +132 -0
- package/frontend/js/components/queryHistoryPanel.js +72 -136
- package/frontend/js/components/structureGraph.js +699 -89
- package/frontend/js/components/tableDesignerEditor.js +3 -5
- package/frontend/js/store.js +188 -7
- package/frontend/js/utils/exportFilenames.js +3 -1
- package/frontend/js/views/charts.js +320 -169
- package/frontend/js/views/connections.js +59 -64
- package/frontend/js/views/data.js +12 -20
- package/frontend/js/views/editor.js +0 -2
- package/frontend/js/views/settings.js +219 -5
- package/frontend/js/views/structure.js +27 -13
- package/frontend/styles/components.css +155 -0
- package/frontend/styles/structure-graph.css +140 -35
- package/frontend/styles/tailwind.generated.css +2 -2
- package/frontend/styles/views.css +12 -6
- package/package.json +7 -6
- package/server/middleware/apiTokenAuth.js +30 -0
- package/server/routes/connections.js +17 -0
- package/server/routes/export.js +89 -22
- package/server/routes/externalApi.js +304 -0
- package/server/routes/settings.js +90 -21
- package/server/server.js +22 -1
- package/server/services/apiTokenService.js +101 -0
- package/server/services/appInfoService.js +215 -0
- package/server/services/databaseCommandService.js +443 -0
- package/server/services/nativeFileDialogService.js +93 -1
- package/server/services/sqlite/exportService.js +307 -22
- package/server/services/storage/appStateStore.js +113 -0
- package/server/utils/errors.js +7 -0
- package/tests/api-token-auth.test.js +236 -0
- package/tests/cli-args.test.js +16 -3
- package/tests/cli-service-delegation.test.js +43 -0
- package/tests/connections-file-dialog-route.test.js +43 -0
- package/tests/copy-column-modal.test.js +34 -0
- package/tests/database-command-service.test.js +139 -0
- package/tests/export-blob.test.js +54 -1
- package/tests/export-filenames.test.js +4 -0
- package/tests/form-controls.test.js +34 -0
- package/tests/native-file-dialog.test.js +27 -0
- package/tests/settings-api-tokens-route.test.js +97 -0
- package/tests/settings-metadata.test.js +99 -1
- package/tests/settings-view.test.js +75 -0
- package/frontend/assets/mockups/connections.png +0 -0
- package/frontend/assets/mockups/data.png +0 -0
- package/frontend/assets/mockups/data_row_editor.png +0 -0
- package/frontend/assets/mockups/home.png +0 -0
- package/frontend/assets/mockups/sql_editor.png +0 -0
- package/frontend/assets/mockups/sql_editor_croped.png +0 -0
- package/frontend/assets/mockups/sql_editor_querydetail.png +0 -0
- package/frontend/assets/mockups/structure.png +0 -0
- package/frontend/assets/mockups/structure_inspector.png +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# sqlite-hub ⚡️
|
|
2
2
|
|
|
3
|
-
](./frontend/assets/mockups/overview_1200.webp)
|
|
4
4
|
|
|
5
5
|
A focused local-first app for browsing, editing, and querying SQLite databases.
|
|
6
6
|
|
|
@@ -13,61 +13,113 @@ Many database tools are powerful, but feel oversized when all you want is to ins
|
|
|
13
13
|
SQLite Hub keeps that workflow sharp:
|
|
14
14
|
|
|
15
15
|
- browse tables and rows
|
|
16
|
+
- open existing databases or create new SQLite files with a native save dialog
|
|
17
|
+
- manage recent connections with labels, custom icons, and read-only mode
|
|
18
|
+
- inspect database health, storage metrics, and schema connectivity from one overview
|
|
16
19
|
- filter, sort, page through, and export table data
|
|
17
20
|
- inspect schema, structure, and relationships
|
|
18
|
-
- edit records in place with an SQL diff preview before saving
|
|
19
|
-
- export tables and query results as CSV, TSV, Markdown, or duplicate them as a table
|
|
21
|
+
- edit records in place with typed value previews and an SQL diff preview before saving
|
|
22
|
+
- export tables and query results as CSV, TSV, Markdown, JSON, Parquet, or duplicate them as a table
|
|
20
23
|
- copy result columns with formatting, headers, first-10 previews, TXT export, and Markdown todo export
|
|
21
24
|
- keep database-scoped Markdown documents with previews, autosave, imports, exports, and saved-query inserts
|
|
22
25
|
- switch between recent databases with sidebar quick picks
|
|
23
26
|
- create simple local backups of the active database
|
|
24
27
|
- run and format SQL in a syntax-highlighted editor with history, messages, and performance metrics
|
|
28
|
+
- keep large interactive query results bounded while full exports remain available
|
|
25
29
|
- turn query-history results into local charts
|
|
26
30
|
- create and edit tables with a live SQL preview
|
|
27
31
|
- stay local and move fast
|
|
28
32
|
|
|
29
33
|
## Features
|
|
30
34
|
|
|
35
|
+
### Connections
|
|
36
|
+
|
|
37
|
+
[](./frontend/assets/mockups/connections_1200.webp)
|
|
38
|
+
|
|
39
|
+
Open an existing SQLite file with a native file picker or create a new database with a native save dialog from the Connections view. Manual absolute-path entry remains available as a fallback for both actions.
|
|
40
|
+
|
|
41
|
+
Recent connections show file size, modification time, last-opened time, and access mode. Connections can be activated, relabeled, moved to another path, opened read-only, assigned a PNG/JPG/WEBP icon, reset to the default icon, or removed from the recent-connections registry without deleting the database file.
|
|
42
|
+
|
|
43
|
+
### Overview
|
|
44
|
+
|
|
45
|
+
The database overview combines operational and schema information for the active database:
|
|
46
|
+
|
|
47
|
+
- file size, page count, table/view counts, index/trigger counts, journal mode, and foreign-key status
|
|
48
|
+
- largest tables by row count and estimated size
|
|
49
|
+
- database path, modification time, SQLite version, page size, freelist count, and encoding
|
|
50
|
+
- schema-map statistics for foreign-key links, connected clusters, and isolated tables
|
|
51
|
+
- integrity and quick-check results, access mode, user version, and schema version
|
|
52
|
+
- shortcuts to the SQL Editor, Structure view, and the database location in Finder
|
|
53
|
+
|
|
31
54
|
### Structure view
|
|
32
55
|
|
|
33
|
-
|
|
56
|
+
<p>
|
|
57
|
+
<a href="./frontend/assets/mockups/structure_1_1200.webp"><img src="./frontend/assets/mockups/structure_1_1200.webp" alt="SQLite Hub relationship graph" width="49%"></a>
|
|
58
|
+
<a href="./frontend/assets/mockups/structure_2_inspector_1200.webp"><img src="./frontend/assets/mockups/structure_2_inspector_1200.webp" alt="SQLite Hub structure inspector" width="49%"></a>
|
|
59
|
+
</p>
|
|
34
60
|
|
|
35
|
-
Inspect tables, columns, types,
|
|
61
|
+
Inspect tables, views, indexes, triggers, columns, declared types, primary keys, nullability, foreign keys, and DDL without losing pace. The searchable object list and relationship graph support fit, relayout, selection clearing, direct navigation to table data, and a hideable inspector/sidebar. Clicking a relationship edge opens a join preview with the mapped columns and a copyable SQL `JOIN` snippet. SQLite Hub remembers the last selected table while you move between views, and DDL can be copied directly from the inspector.
|
|
36
62
|
|
|
37
63
|
### Data browser
|
|
38
64
|
|
|
39
|
-
](./frontend/assets/mockups/data_1_1200.webp)
|
|
40
66
|
|
|
41
|
-
Scan rows, sort
|
|
67
|
+
Scan rows, sort columns, move through local data quickly, and export full tables as CSV, TSV, Markdown, JSON, or Parquet. The Data browser also supports duplicating exports as a new table, searchable and hideable table navigation, page sizes up to 250 rows, and advanced filters with column/operator/value controls. Text filters support case-insensitive `contains`, `not contains`, and exact `equals` matching.
|
|
68
|
+
|
|
69
|
+
Wide tables keep their horizontal scroll position when sorting causes the grid to re-render. Cells use compact previews for long values, BLOBs, and detected file paths, while exports retain complete BLOB content.
|
|
42
70
|
|
|
43
71
|
### Row editing
|
|
44
72
|
|
|
45
|
-
](./frontend/assets/mockups/data_2_row_editor_1200.webp)
|
|
74
|
+
|
|
75
|
+
Open one record, edit it in place, preview the generated SQL and changed values, then commit or delete the row with confirmation. SQLite Hub only enables row edits when it can target a stable primary-key or rowid identity safely.
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
The Row Editor adds contextual previews without changing the stored raw value:
|
|
78
|
+
|
|
79
|
+
- visible `NULL`, `EMPTY STRING`, and `VALUE` states, with untouched `NULL` values preserved on save
|
|
80
|
+
- formatted JSON object and array previews with indentation and line breaks
|
|
81
|
+
- full-row JSON preview with copy and `.json` export actions
|
|
82
|
+
- clickable HTTP/HTTPS URL detection
|
|
83
|
+
- file-path detection with filename, directory, extension, and path type
|
|
84
|
+
- timestamp interpretation for plausible numeric, ISO, and SQLite datetime values while protecting key columns
|
|
85
|
+
- character counts for non-empty text values
|
|
86
|
+
- select controls for simple string `CHECK (... IN (...))` constraints
|
|
48
87
|
|
|
49
88
|
### SQL editor
|
|
50
89
|
|
|
51
|
-
](./frontend/assets/mockups/sql_editor_1_1200.webp)
|
|
91
|
+
|
|
92
|
+
Write queries in a syntax-highlighted editor, execute them with the Run button or `Shift + Enter`, format SQL with the editor Format button, inspect results in the same workflow, and export result sets as CSV, TSV, Markdown, JSON, Parquet, or duplicate them as a table. Query drafts survive reloads, query history can be searched and saved, and direct single-table `SELECT` results can be edited or deleted from the result grid when a stable row identity is available.
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
Interactive result sets are limited to the first 5,000 rows to keep the application responsive. A visible notice and Messages entry indicate truncation; CSV, TSV, Markdown, JSON, Parquet, and duplicate-table exports execute without that interactive row limit and include complete BLOB values. Sorting wide results preserves the horizontal scroll position.
|
|
95
|
+
|
|
96
|
+
[](./frontend/assets/mockups/sql_editor_5_export_query_result_1200.webp)
|
|
54
97
|
|
|
55
98
|
Result column menus include copy actions for a full column, a column with header, or the first 10 values. The same modal can preview the output, copy it, export it as TXT, or turn a column into Markdown todo items.
|
|
56
99
|
|
|
100
|
+
<p>
|
|
101
|
+
<a href="./frontend/assets/mockups/sql_editor_3_export_column_1200.webp"><img src="./frontend/assets/mockups/sql_editor_3_export_column_1200.webp" alt="SQLite Hub copy column dialog" width="49%"></a>
|
|
102
|
+
<a href="./frontend/assets/mockups/sql_editor_4_export_column_as_markdown_1200.webp"><img src="./frontend/assets/mockups/sql_editor_4_export_column_as_markdown_1200.webp" alt="SQLite Hub Markdown todo export" width="49%"></a>
|
|
103
|
+
</p>
|
|
104
|
+
|
|
57
105
|
The bottom panel keeps separate tabs for:
|
|
58
106
|
|
|
59
107
|
- Results
|
|
60
108
|
- Performance, including execution time, statement count, returned rows, affected rows, and serialized result memory size
|
|
61
109
|
- Messages, including the executed query and statement updates/errors
|
|
62
110
|
|
|
63
|
-
Potentially destructive statements are tracked in query history, and SQLite Hub keeps the active result tab instead of forcing you back to Results after every execution.
|
|
111
|
+
Potentially destructive statements are tracked in query history, and SQLite Hub keeps the active result tab instead of forcing you back to Results after every execution. Multi-statement SQL is reported statement by statement, including returned rows, affected rows, truncation warnings, executed SQL, errors, timing, and serialized result size.
|
|
64
112
|
|
|
65
113
|
### Query history
|
|
66
114
|
|
|
67
|
-
SQLite Hub
|
|
115
|
+
[](./frontend/assets/mockups/sql_editor_2_query_details_1200.webp)
|
|
116
|
+
|
|
117
|
+
SQLite Hub stores query history per database. You can browse recent and saved tabs, search SQL, titles, and notes, assign titles and notes, mark useful queries as saved, delete history entries, load older entries, re-run previous queries, reopen them in the editor, and execute saved queries from the CLI.
|
|
68
118
|
|
|
69
119
|
### Documents
|
|
70
120
|
|
|
121
|
+
[](./frontend/assets/mockups/documents_1200.webp)
|
|
122
|
+
|
|
71
123
|
Documents are local Markdown notes scoped to the active database. SQLite Hub creates a document folder per database, keeps the sidebar fixed while the editor and preview panes scroll independently, and autosaves changes after a short debounce. You can create, rename, delete, import `.md` files, export the current document as Markdown, and toggle the editor or preview pane as needed.
|
|
72
124
|
|
|
73
125
|
The preview supports regular Markdown, ordered and unordered lists, tables, code blocks, links, and clickable task-list checkboxes. Documents can also pull context from saved SQL Editor queries:
|
|
@@ -78,20 +130,48 @@ The preview supports regular Markdown, ordered and unordered lists, tables, code
|
|
|
78
130
|
|
|
79
131
|
### Charts
|
|
80
132
|
|
|
81
|
-
|
|
133
|
+
[](./frontend/assets/mockups/charts_1_bars_1200.webp)
|
|
134
|
+
|
|
135
|
+
Create bar, line, pie/donut, and scatter charts from chartable `SELECT` query-history entries. Charts can be saved per query, edited, deleted, resized, reopened later, rendered from live query results, and exported as PNG. Chart configuration supports compatible column selection, sorting, labels, legends, line smoothing, scatter series, and optional scatter point sizing.
|
|
136
|
+
|
|
137
|
+
<p>
|
|
138
|
+
<a href="./frontend/assets/mockups/charts_2_pie_1200.webp"><img src="./frontend/assets/mockups/charts_2_pie_1200.webp" alt="SQLite Hub pie chart" width="49%"></a>
|
|
139
|
+
<a href="./frontend/assets/mockups/charts_3_scatter_plot_1200.webp"><img src="./frontend/assets/mockups/charts_3_scatter_plot_1200.webp" alt="SQLite Hub scatter plot" width="49%"></a>
|
|
140
|
+
</p>
|
|
82
141
|
|
|
83
142
|
### Table Designer
|
|
84
143
|
|
|
85
|
-
|
|
144
|
+
[](./frontend/assets/mockups/table_designer_1_1200.webp)
|
|
145
|
+
|
|
146
|
+
Create and edit SQLite tables from the UI. The Table Designer includes a searchable table list, validation and migration warnings, and controls for column names, SQLite types, `NOT NULL`, `UNIQUE`, primary keys, SQL defaults, foreign-key tables/columns, and check constraints. Existing composite unique constraints are surfaced as schema metadata.
|
|
147
|
+
|
|
148
|
+
CSV files can seed a new table draft and optionally fill the created table with imported rows. Every change produces a copyable live SQL preview that can be hidden or shown before the schema operation is applied.
|
|
149
|
+
|
|
150
|
+
[](./frontend/assets/mockups/table_designer_2_checks_1200.webp)
|
|
86
151
|
|
|
87
152
|
### Media Tagging
|
|
88
153
|
|
|
89
|
-
|
|
154
|
+
[](./frontend/assets/mockups/media_tagging_1_setup_1200.webp)
|
|
155
|
+
|
|
156
|
+
Configure a media table, path/status columns, tag table, mapping table, and the SQL queries that drive tagged and untagged queues. SQLite Hub can create the default tag and mapping tables, validate the setup, reset default queries, and preview image, video, and audio assets from paths scoped to the active database directory.
|
|
157
|
+
|
|
158
|
+
The queue supports tag search, tag creation/removal, parent tags, copying tags from the previous item, applying selected tags, skipping items, resetting skipped items, rotating visual media, hiding/showing media details, and opening the current row in Data or Structure. `Shift + Enter` applies the selected tags and advances to the next item.
|
|
159
|
+
|
|
160
|
+
<p>
|
|
161
|
+
<a href="./frontend/assets/mockups/media_tagging_2_tagging_queue_1200.webp"><img src="./frontend/assets/mockups/media_tagging_2_tagging_queue_1200.webp" alt="SQLite Hub tagging queue" width="49%"></a>
|
|
162
|
+
<a href="./frontend/assets/mockups/media_tagging_3_media_viewer_1200.webp"><img src="./frontend/assets/mockups/media_tagging_3_media_viewer_1200.webp" alt="SQLite Hub media viewer" width="49%"></a>
|
|
163
|
+
</p>
|
|
90
164
|
|
|
91
165
|
### UI preferences
|
|
92
166
|
|
|
93
167
|
SQLite Hub remembers common workspace preferences in local storage, including hidden panels, selected editor tabs, query drafts, chart panels, table row size, and Table Designer preview visibility.
|
|
94
168
|
|
|
169
|
+
### Settings
|
|
170
|
+
|
|
171
|
+
[](./frontend/assets/mockups/settings_1200.webp)
|
|
172
|
+
|
|
173
|
+
The Settings view reports the installed SQLite Hub version and the actual SQLite runtime version used to execute queries. It also keeps the custom-port CLI command, project website, and source repository available in the application.
|
|
174
|
+
|
|
95
175
|
### Database quick picks
|
|
96
176
|
|
|
97
177
|
The active database footer in the sidebar opens a quick-pick panel with the five most recent databases, so you can switch databases without going back to the Connections view.
|
|
@@ -102,7 +182,7 @@ Create timestamped local backups of the active SQLite database in one click. Bac
|
|
|
102
182
|
|
|
103
183
|
### Local-first
|
|
104
184
|
|
|
105
|
-
Built around local SQLite files, not hosted dashboards or team complexity.
|
|
185
|
+
Built around local SQLite files, not hosted dashboards or team complexity. The server binds explicitly to the IPv4 loopback interface, and API middleware rejects foreign hosts and cross-origin mutations while still allowing same-origin browser and local CLI requests.
|
|
106
186
|
|
|
107
187
|
## Install
|
|
108
188
|
|
|
@@ -135,7 +215,7 @@ SQLite Hub ships with a built-in CLI that lets you start the app or query inform
|
|
|
135
215
|
sqlite-hub # start on default port 4173
|
|
136
216
|
sqlite-hub --port:4174 # start on a custom port
|
|
137
217
|
sqlite-hub --open # open SQLite Hub in the browser
|
|
138
|
-
sqlite-hub --
|
|
218
|
+
sqlite-hub --info # show port, URL, versions, and update status
|
|
139
219
|
sqlite-hub --help # show help text
|
|
140
220
|
sqlite-hub --version # show version number
|
|
141
221
|
```
|
|
@@ -181,7 +261,18 @@ sqlite-hub --database:Billly --table:companies
|
|
|
181
261
|
|
|
182
262
|
Prints table metadata such as columns, primary keys, foreign keys, indexes, row count, and row identity strategy.
|
|
183
263
|
|
|
184
|
-
### SQL Editor - Saved Queries
|
|
264
|
+
### SQL Editor - Raw SQL And Saved Queries
|
|
265
|
+
|
|
266
|
+
Execute raw SQL through the same SQL Editor execution path used by the app:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
sqlite-hub --database:Unit-00 --query:"SELECT * FROM companies LIMIT 10"
|
|
270
|
+
sqlite-hub --database:Unit-00 --query:"SELECT * FROM companies LIMIT 10" --store:"Company Sample"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Raw CLI queries are recorded in Query History. Add `--store:"name"` to title the
|
|
274
|
+
history item and mark it as saved. Raw SQL execution is rejected when the target
|
|
275
|
+
database is marked read-only.
|
|
185
276
|
|
|
186
277
|
List all saved queries for a database:
|
|
187
278
|
|
|
@@ -200,7 +291,7 @@ This searches the query history for the given database, finds the matching saved
|
|
|
200
291
|
Show the saved query SQL without executing it:
|
|
201
292
|
|
|
202
293
|
```bash
|
|
203
|
-
sqlite-hub --database:Unit-00 --query:"Stock Winners"
|
|
294
|
+
sqlite-hub --database:Unit-00 --saved-query:"Stock Winners"
|
|
204
295
|
```
|
|
205
296
|
|
|
206
297
|
Show the saved notes for a query:
|
|
@@ -209,12 +300,13 @@ Show the saved notes for a query:
|
|
|
209
300
|
sqlite-hub --database:Unit-00 --notes:"TOP25 Loser and Winner EOD, T1, T3, T5"
|
|
210
301
|
```
|
|
211
302
|
|
|
212
|
-
Export a saved query using the same CSV, TSV, and
|
|
303
|
+
Export a saved query using the same CSV, TSV, Markdown, and JSON export logic as the SQL Editor:
|
|
213
304
|
|
|
214
305
|
```bash
|
|
215
306
|
sqlite-hub --database:Unit-00 --export:"Stock Winners" --format:csv
|
|
216
307
|
sqlite-hub --database:Unit-00 --export:"Stock Winners" --format:tsv
|
|
217
308
|
sqlite-hub --database:Unit-00 --export:"Stock Winners" --format:md
|
|
309
|
+
sqlite-hub --database:Unit-00 --export:"Stock Winners" --format:json
|
|
218
310
|
```
|
|
219
311
|
|
|
220
312
|
The export is written to the current working directory using the generated query export filename.
|
|
@@ -252,37 +344,37 @@ sqlite-hub --database:Unit-00 --table:companies --export:0a754aba373d34972998792
|
|
|
252
344
|
|
|
253
345
|
### Available flags
|
|
254
346
|
|
|
255
|
-
| Flag
|
|
256
|
-
|
|
|
257
|
-
| `--help`, `-h`
|
|
258
|
-
| `--version`, `-v`
|
|
259
|
-
| `--
|
|
260
|
-
| `--open`
|
|
261
|
-
| `--port:PORT`
|
|
262
|
-
| `--database`, `-d`
|
|
263
|
-
| `--database:name`
|
|
264
|
-
| `--database:name --path`
|
|
265
|
-
| `--database:name --size`
|
|
266
|
-
| `--database:name --lastopened`
|
|
267
|
-
| `--database:name --tables`
|
|
268
|
-
| `--database:name --queries`
|
|
269
|
-
| `--database:name --
|
|
270
|
-
| `--database:name --query:"
|
|
271
|
-
| `--database:name --
|
|
272
|
-
| `--database:name --
|
|
273
|
-
| `--database:name --
|
|
274
|
-
| `--database:name --
|
|
275
|
-
| `--database:name --documents
|
|
276
|
-
| `--database:name --
|
|
277
|
-
| `--database:name --
|
|
347
|
+
| Flag | Description |
|
|
348
|
+
| --------------------------------------------------------------- | ----------------------------------------------- |
|
|
349
|
+
| `--help`, `-h` | Show help text |
|
|
350
|
+
| `--version`, `-v` | Show version number |
|
|
351
|
+
| `--info` | Show port, URL, versions, and update status |
|
|
352
|
+
| `--open` | Open SQLite Hub in the browser |
|
|
353
|
+
| `--port:PORT` | Start the server on a custom port |
|
|
354
|
+
| `--database`, `-d` | List all imported databases |
|
|
355
|
+
| `--database:name` | Select a database by name or id |
|
|
356
|
+
| `--database:name --path` | Get the file path of a database |
|
|
357
|
+
| `--database:name --size` | Get the size of a database |
|
|
358
|
+
| `--database:name --lastopened` | Get the last opened timestamp |
|
|
359
|
+
| `--database:name --tables` | Get all table names from a database |
|
|
360
|
+
| `--database:name --queries` | List saved queries for a database |
|
|
361
|
+
| `--database:name --query:"sql"` | Execute raw SQL and record it in Query History |
|
|
362
|
+
| `--database:name --query:"sql" --store:"name"` | Save a raw query in Query History with a name |
|
|
363
|
+
| `--database:name --execute:"query"` | Execute a saved query by name |
|
|
364
|
+
| `--database:name --saved-query:"query"` | Print a saved query by name |
|
|
365
|
+
| `--database:name --notes:"query"` | Print saved notes for a query |
|
|
366
|
+
| `--database:name --export:"query" --format:csv\|tsv\|md\|json` | Set query export format |
|
|
367
|
+
| `--database:name --documents` | List Markdown documents for a database |
|
|
368
|
+
| `--database:name --documents:"document"` | Print a document's Markdown content |
|
|
369
|
+
| `--database:name --documents:"document" --export` | Export a document as Markdown |
|
|
370
|
+
| `--database:name --table:"table"` | Print table metadata |
|
|
371
|
+
| `--database:name --table:"table" --export:"pk"` | Export one row as JSON |
|
|
278
372
|
|
|
279
373
|
Legacy aliases such as `--database-path:name`, `--database-size:name`, `--database-lastopened:name`, `--database-tables:name`, and `--database:name --sqleditor:"query"` still work.
|
|
280
374
|
|
|
281
375
|
### SQL editor CLI example
|
|
282
376
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
In the screenshot above, you can see a saved query from the SQL editor. You can create these queries using the graphical interface and execute them via the CLI if you want. To execute one, you would run:
|
|
377
|
+
Saved queries created in the graphical SQL Editor can also be executed through the CLI. To execute one, run:
|
|
286
378
|
|
|
287
379
|
```bash
|
|
288
380
|
sqlite-hub --database:Unit-00 --execute:"Group by creation Year"
|
|
@@ -308,6 +400,10 @@ Results:
|
|
|
308
400
|
[2] 2026 | 40
|
|
309
401
|
```
|
|
310
402
|
|
|
403
|
+
## API
|
|
404
|
+
|
|
405
|
+
SQLite Hub also provides a local JSON API for app info, database metadata, tables, saved queries, exports, and documents. `/api/v1/info` returns the same app/version status as `sqlite-hub --info`; database data is protected by database-specific API tokens created in Settings. See the [API documentation](./docs/API.md) for authentication, endpoints, and examples.
|
|
406
|
+
|
|
311
407
|
## Changelog
|
|
312
408
|
|
|
313
409
|
[Changelog](./docs/changelog.md)
|