sqlite-hub 0.4.0 → 0.6.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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/changelog.md +15 -0
  3. package/frontend/assets/mockups/connections.png +0 -0
  4. package/frontend/assets/mockups/data.png +0 -0
  5. package/frontend/assets/mockups/data_row_editor.png +0 -0
  6. package/frontend/assets/mockups/home.png +0 -0
  7. package/frontend/assets/mockups/sql_editor.png +0 -0
  8. package/frontend/assets/mockups/sql_editor_querydetail.png +0 -0
  9. package/frontend/assets/mockups/structure.png +0 -0
  10. package/frontend/assets/mockups/structure_inspector.png +0 -0
  11. package/frontend/js/api.js +114 -5
  12. package/frontend/js/app.js +368 -18
  13. package/frontend/js/components/bottomTabs.js +1 -1
  14. package/frontend/js/components/dataGrid.js +3 -3
  15. package/frontend/js/components/queryEditor.js +33 -55
  16. package/frontend/js/components/queryHistoryDetail.js +263 -0
  17. package/frontend/js/components/queryHistoryPanel.js +228 -0
  18. package/frontend/js/components/queryResults.js +32 -46
  19. package/frontend/js/components/rowEditorPanel.js +73 -14
  20. package/frontend/js/components/sidebar.js +1 -0
  21. package/frontend/js/components/tableDesignerEditor.js +356 -0
  22. package/frontend/js/components/tableDesignerSidebar.js +126 -0
  23. package/frontend/js/components/tableDesignerSqlPreview.js +40 -0
  24. package/frontend/js/router.js +10 -0
  25. package/frontend/js/store.js +841 -22
  26. package/frontend/js/utils/format.js +23 -0
  27. package/frontend/js/utils/tableDesigner.js +1192 -0
  28. package/frontend/js/views/data.js +273 -250
  29. package/frontend/js/views/editor.js +34 -10
  30. package/frontend/js/views/overview.js +15 -0
  31. package/frontend/js/views/tableDesigner.js +37 -0
  32. package/frontend/styles/base.css +87 -73
  33. package/frontend/styles/components.css +841 -188
  34. package/frontend/styles/views.css +40 -0
  35. package/package.json +1 -1
  36. package/server/routes/data.js +2 -0
  37. package/server/routes/export.js +4 -1
  38. package/server/routes/overview.js +12 -0
  39. package/server/routes/sql.js +163 -5
  40. package/server/routes/tableDesigner.js +60 -0
  41. package/server/server.js +5 -1
  42. package/server/services/sqlite/dataBrowserService.js +4 -16
  43. package/server/services/sqlite/exportService.js +4 -16
  44. package/server/services/sqlite/overviewService.js +34 -0
  45. package/server/services/sqlite/sqlExecutor.js +83 -63
  46. package/server/services/sqlite/tableDesigner/changeAnalysis.js +295 -0
  47. package/server/services/sqlite/tableDesigner/schemaMapping.js +233 -0
  48. package/server/services/sqlite/tableDesigner/sql.js +63 -0
  49. package/server/services/sqlite/tableDesigner/validation.js +245 -0
  50. package/server/services/sqlite/tableDesignerService.js +181 -0
  51. package/server/services/sqlite/tableSort.js +63 -0
  52. package/server/services/storage/appStateStore.js +674 -1
  53. package/server/services/storage/queryHistoryUtils.js +169 -0
  54. package/frontend/assets/mockups/data_edit.png +0 -0
  55. package/frontend/assets/mockups/graph_visualize.png +0 -0
  56. package/frontend/assets/mockups/overview.png +0 -0
package/README.md CHANGED
@@ -24,7 +24,7 @@ SQLite Hub keeps that workflow sharp:
24
24
 
25
25
  ### Structure view
26
26
 
27
- ![](./frontend/assets/mockups/graph_visualize.png)
27
+ ![](./frontend/assets/mockups/structure.png)
28
28
 
29
29
  Inspect tables, columns, types, and schema details without losing pace. Visualized in a graph.
30
30
 
@@ -36,7 +36,7 @@ Scan rows, sort fast, move through local data quickly, and export full tables as
36
36
 
37
37
  ### Row editing
38
38
 
39
- ![](./frontend/assets/mockups/data_edit.png)
39
+ ![](./frontend/assets/mockups/data_row_editor.png)
40
40
 
41
41
  Open one record, edit it in place, commit, continue.
42
42
 
package/changelog.md CHANGED
@@ -1,3 +1,18 @@
1
+ # v0.6.0
2
+
3
+ - table designer, create tables in sqlit_hub
4
+
5
+ # v0.5.1
6
+
7
+ - bug fix in sql editor
8
+
9
+ # v0.5.0
10
+
11
+ - sql query history
12
+ - open in finder in overview
13
+ - sort columns in data & sql_editor
14
+ - json view in row editor
15
+
1
16
  # v0.4.0
2
17
 
3
18
  - search in data
Binary file
Binary file
@@ -123,6 +123,12 @@ export function getOverview() {
123
123
  return request("/api/db/overview");
124
124
  }
125
125
 
126
+ export function openOverviewInFinder() {
127
+ return request("/api/db/overview/open-in-finder", {
128
+ method: "POST",
129
+ });
130
+ }
131
+
126
132
  export function getDbStatus() {
127
133
  return request("/api/db/status");
128
134
  }
@@ -134,16 +140,92 @@ export function executeSql(sql) {
134
140
  });
135
141
  }
136
142
 
137
- export function getSqlHistory() {
138
- return request("/api/sql/history");
143
+ export function getQueryHistory(options = {}) {
144
+ const params = new URLSearchParams();
145
+
146
+ if (options.tab) {
147
+ params.set("tab", String(options.tab));
148
+ }
149
+
150
+ if (options.limit !== undefined) {
151
+ params.set("limit", String(options.limit));
152
+ }
153
+
154
+ if (options.offset !== undefined) {
155
+ params.set("offset", String(options.offset));
156
+ }
157
+
158
+ if (options.search) {
159
+ params.set("search", String(options.search));
160
+ }
161
+
162
+ if (options.queryType) {
163
+ params.set("queryType", String(options.queryType));
164
+ }
165
+
166
+ if (options.onlySaved) {
167
+ params.set("onlySaved", "true");
168
+ }
169
+
170
+ if (options.onlyFavorites) {
171
+ params.set("onlyFavorites", "true");
172
+ }
173
+
174
+ const query = params.toString();
175
+ return request(`/api/sql/history${query ? `?${query}` : ""}`);
139
176
  }
140
177
 
141
- export function clearSqlHistory() {
178
+ export function clearQueryHistory() {
142
179
  return request("/api/sql/history", {
143
180
  method: "DELETE",
144
181
  });
145
182
  }
146
183
 
184
+ export function getQueryHistoryItem(historyId) {
185
+ return request(`/api/sql/history/${encodeURIComponent(historyId)}`);
186
+ }
187
+
188
+ export function getQueryHistoryRuns(historyId, options = {}) {
189
+ const params = new URLSearchParams();
190
+
191
+ if (options.limit !== undefined) {
192
+ params.set("limit", String(options.limit));
193
+ }
194
+
195
+ const query = params.toString();
196
+
197
+ return request(
198
+ `/api/sql/history/${encodeURIComponent(historyId)}/runs${query ? `?${query}` : ""}`
199
+ );
200
+ }
201
+
202
+ export function toggleQueryHistorySaved(historyId, value) {
203
+ return request(`/api/sql/history/${encodeURIComponent(historyId)}/saved`, {
204
+ method: "PATCH",
205
+ body: { value },
206
+ });
207
+ }
208
+
209
+ export function renameQueryHistoryItem(historyId, title) {
210
+ return request(`/api/sql/history/${encodeURIComponent(historyId)}/title`, {
211
+ method: "PATCH",
212
+ body: { title },
213
+ });
214
+ }
215
+
216
+ export function updateQueryHistoryNotes(historyId, notes) {
217
+ return request(`/api/sql/history/${encodeURIComponent(historyId)}/notes`, {
218
+ method: "PATCH",
219
+ body: { notes },
220
+ });
221
+ }
222
+
223
+ export function deleteQueryHistoryItem(historyId) {
224
+ return request(`/api/sql/history/${encodeURIComponent(historyId)}`, {
225
+ method: "DELETE",
226
+ });
227
+ }
228
+
147
229
  export function getStructureOverview() {
148
230
  return request("/api/structure");
149
231
  }
@@ -152,6 +234,21 @@ export function getStructureDetail(tableName) {
152
234
  return request(`/api/structure/${encodeURIComponent(tableName)}`);
153
235
  }
154
236
 
237
+ export function getTableDesignerOverview() {
238
+ return request("/api/table-designer");
239
+ }
240
+
241
+ export function getTableDesignerTable(tableName) {
242
+ return request(`/api/table-designer/${encodeURIComponent(tableName)}`);
243
+ }
244
+
245
+ export function saveTableDesignerDraft(payload) {
246
+ return request("/api/table-designer/save", {
247
+ method: "POST",
248
+ body: payload,
249
+ });
250
+ }
251
+
155
252
  export function getDataTables() {
156
253
  return request("/api/data");
157
254
  }
@@ -167,6 +264,14 @@ export function getDataTable(tableName, options = {}) {
167
264
  params.set("offset", String(options.offset));
168
265
  }
169
266
 
267
+ if (options.sortColumn) {
268
+ params.set("sortColumn", String(options.sortColumn));
269
+ }
270
+
271
+ if (options.sortDirection) {
272
+ params.set("sortDirection", String(options.sortDirection));
273
+ }
274
+
170
275
  const query = params.toString();
171
276
 
172
277
  return request(`/api/data/${encodeURIComponent(tableName)}${query ? `?${query}` : ""}`);
@@ -205,10 +310,14 @@ export function downloadQueryCsv(sql) {
205
310
  });
206
311
  }
207
312
 
208
- export function downloadTableCsv(tableName) {
313
+ export function downloadTableCsv(tableName, options = {}) {
209
314
  return download("/api/export/table.csv", {
210
315
  method: "POST",
211
- body: { tableName },
316
+ body: {
317
+ tableName,
318
+ sortColumn: options.sortColumn,
319
+ sortDirection: options.sortDirection,
320
+ },
212
321
  fallbackFilename: `${tableName || "table"}.csv`,
213
322
  });
214
323
  }