@powersync/nuxt 0.0.0-dev-20260827080125 → 0.0.0-dev-20261015114518

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 (55) hide show
  1. package/README.md +36 -59
  2. package/dist/module.d.mts +4 -3
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +74 -64
  5. package/dist/runtime/assets/devtools-theme.d.ts +1 -0
  6. package/dist/runtime/assets/devtools-theme.js +33 -0
  7. package/dist/runtime/options.d.ts +13 -0
  8. package/dist/runtime/options.js +0 -0
  9. package/dist/runtime/plugin.client.js +8 -8
  10. package/package.json +12 -13
  11. package/dist/runtime/components/BucketsInspectorTab.d.vue.ts +0 -3
  12. package/dist/runtime/components/BucketsInspectorTab.vue +0 -544
  13. package/dist/runtime/components/BucketsInspectorTab.vue.d.ts +0 -3
  14. package/dist/runtime/components/ConfigInspectorTab.d.vue.ts +0 -3
  15. package/dist/runtime/components/ConfigInspectorTab.vue +0 -84
  16. package/dist/runtime/components/ConfigInspectorTab.vue.d.ts +0 -3
  17. package/dist/runtime/components/DataInspectorTab.d.vue.ts +0 -3
  18. package/dist/runtime/components/DataInspectorTab.vue +0 -564
  19. package/dist/runtime/components/DataInspectorTab.vue.d.ts +0 -3
  20. package/dist/runtime/components/LoadingSpinner.d.vue.ts +0 -3
  21. package/dist/runtime/components/LoadingSpinner.vue +0 -12
  22. package/dist/runtime/components/LoadingSpinner.vue.d.ts +0 -3
  23. package/dist/runtime/components/LogsTab.d.vue.ts +0 -3
  24. package/dist/runtime/components/LogsTab.vue +0 -273
  25. package/dist/runtime/components/LogsTab.vue.d.ts +0 -3
  26. package/dist/runtime/components/PowerSyncInstanceTab.d.vue.ts +0 -3
  27. package/dist/runtime/components/PowerSyncInstanceTab.vue +0 -7
  28. package/dist/runtime/components/PowerSyncInstanceTab.vue.d.ts +0 -3
  29. package/dist/runtime/components/SyncStatusTab.d.vue.ts +0 -3
  30. package/dist/runtime/components/SyncStatusTab.vue +0 -161
  31. package/dist/runtime/components/SyncStatusTab.vue.d.ts +0 -3
  32. package/dist/runtime/composables/usePowerSyncInspector.d.ts +0 -39
  33. package/dist/runtime/composables/usePowerSyncInspector.js +0 -17
  34. package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.d.ts +0 -153
  35. package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.js +0 -216
  36. package/dist/runtime/layouts/powersync-inspector-layout.d.vue.ts +0 -13
  37. package/dist/runtime/layouts/powersync-inspector-layout.vue +0 -63
  38. package/dist/runtime/layouts/powersync-inspector-layout.vue.d.ts +0 -13
  39. package/dist/runtime/pages/__powersync-inspector.d.vue.ts +0 -3
  40. package/dist/runtime/pages/__powersync-inspector.vue +0 -119
  41. package/dist/runtime/pages/__powersync-inspector.vue.d.ts +0 -3
  42. package/dist/runtime/utils/AppSchema.d.ts +0 -27
  43. package/dist/runtime/utils/AppSchema.js +0 -23
  44. package/dist/runtime/utils/DynamicSchemaManager.d.ts +0 -16
  45. package/dist/runtime/utils/DynamicSchemaManager.js +0 -82
  46. package/dist/runtime/utils/JsSchemaGenerator.d.ts +0 -8
  47. package/dist/runtime/utils/JsSchemaGenerator.js +0 -28
  48. package/dist/runtime/utils/NuxtPowerSyncDatabase.d.ts +0 -42
  49. package/dist/runtime/utils/NuxtPowerSyncDatabase.js +0 -97
  50. package/dist/runtime/utils/RustClientInterceptor.d.ts +0 -24
  51. package/dist/runtime/utils/RustClientInterceptor.js +0 -90
  52. package/dist/runtime/utils/TokenConnector.d.ts +0 -14
  53. package/dist/runtime/utils/TokenConnector.js +0 -57
  54. package/dist/runtime/utils/index.d.ts +0 -1
  55. package/dist/runtime/utils/index.js +0 -1
@@ -1,564 +0,0 @@
1
- <template>
2
- <div border="t" border-color="gray-200" relative n-bg="base" flex="~ col" h="screen" overflow="hidden">
3
- <SplitterGroup id="splitter-group-1" class="h-full" direction="horizontal">
4
- <SplitterPanel
5
- id="splitter-group-1-panel-1"
6
- :min-size="20"
7
- :default-size="20"
8
- class="border-x border-b border-gray-200 flex flex-col overflow-hidden"
9
- >
10
- <div class="flex-1 flex flex-col overflow-hidden">
11
- <!-- Search Bar -->
12
- <div class="p-2 border-b border-gray-200 dark:border-neutral-700">
13
- <NTextInput
14
- v-model="searchQuery"
15
- n="xs"
16
- class="w-full"
17
- placeholder="Search tables and views..."
18
- icon="carbon:search"
19
- @input="onSearchInput"
20
- />
21
- </div>
22
-
23
- <!-- Tree Container -->
24
- <div class="flex-1 overflow-y-auto">
25
- <TreeRoot
26
- v-if="filteredTreeData && filteredTreeData.length > 0"
27
- v-slot="{ flattenItems }"
28
- v-model="selectedEntry"
29
- v-model:expanded="expandedItems"
30
- :items="filteredTreeData"
31
- :get-key="(item2) => item2.name"
32
- :get-children="(item2) => item2.children || void 0"
33
- class="h-full"
34
- >
35
- <TreeItem
36
- v-for="item in flattenItems"
37
- :key="item._id"
38
- v-bind="item.bind"
39
- v-slot="{ isExpanded, isSelected }"
40
- @select="
41
- (event) => {
42
- if (item.value.type !== 'folder') {
43
- selectEntry(item.value);
44
- }
45
- }
46
- "
47
- >
48
- <div
49
- class="flex items-center gap-2 py-1 px-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-neutral-700 w-full"
50
- :class="{
51
- 'bg-gray-300 dark:bg-neutral-700 font-semibold': isSelected && item.value.type !== 'folder',
52
- 'font-medium': item.value.type === 'folder'
53
- }"
54
- :style="{ paddingLeft: `${item.level * 16 + 8}px` }"
55
- >
56
- <!-- Folder/Item Icon -->
57
- <NIcon
58
- :icon="
59
- item.value.type === 'folder' ? isExpanded ? 'carbon:folder-open' : 'carbon:folder' : item.value.icon
60
- "
61
- n="sm"
62
- class="flex-shrink-0"
63
- :class="item.value.type === 'folder' ? 'text-indigo-500' : 'text-gray-500'"
64
- />
65
-
66
- <!-- Name -->
67
- <span class="truncate">{{ item.value.name }}</span>
68
-
69
- <!-- Expand/Collapse indicator for folders -->
70
- <NIcon
71
- v-if="item.value.type === 'folder'"
72
- :icon="isExpanded ? 'carbon:chevron-down' : 'carbon:chevron-right'"
73
- class="flex-shrink-0 ml-auto text-gray-400"
74
- />
75
- </div>
76
- </TreeItem>
77
- </TreeRoot>
78
-
79
- <!-- No Results Message -->
80
- <div
81
- v-else-if="searchQuery && filteredTreeData.length === 0"
82
- class="flex-1 flex items-center justify-center text-gray-500 dark:text-gray-400 text-sm"
83
- >
84
- No tables or views found for "{{ searchQuery }}"
85
- </div>
86
- </div>
87
- </div>
88
- </SplitterPanel>
89
- <SplitterResizeHandle
90
- id="splitter-group-1-resize-handle-1"
91
- class="w-[2px] bg-gray-200 hover:bg-indigo-300 dark:hover:bg-indigo-700"
92
- />
93
- <SplitterPanel id="splitter-group-1-panel-2" :min-size="20" class="border-b border-x border-gray-200">
94
- <div v-if="!selectedEntry" class="flex w-full h-full justify-center items-center align-middle">
95
- <div text="sm gray-500" flex="~ gap-2 items-center">
96
- <NIcon icon="carbon:document-blank" />
97
- <span>No Selection</span>
98
- </div>
99
- </div>
100
- <SplitterGroup v-else id="splitter-group-2" direction="vertical">
101
- <SplitterPanel id="splitter-group-2-panel-1" :min-size="10" :default-size="10">
102
- <!-- Custom Code Editor with Syntax Highlighting -->
103
- <div class="relative h-full w-full">
104
- <!-- Syntax Highlighted Background -->
105
- <div
106
- ref="highlightContainer"
107
- class="absolute inset-0 pointer-events-none overflow-auto"
108
- :style="{ scrollBehavior: 'auto' }"
109
- >
110
- <div class="syntax-highlight-bg" v-html="html" />
111
- </div>
112
-
113
- <!-- Transparent Textarea Overlay -->
114
- <textarea
115
- ref="textareaRef"
116
- v-model="query"
117
- class="absolute inset-0 w-full h-full resize-none bg-transparent outline-none border-none overflow-auto editor-textarea dark:placeholder:text-gray-400"
118
- style="color: rgba(0, 0, 0, 0.01); text-shadow: 0 0 0 transparent"
119
- placeholder="Enter SQL query..."
120
- spellcheck="false"
121
- autocorrect="off"
122
- autocomplete="off"
123
- autocapitalize="off"
124
- data-gramm="false"
125
- @keydown.enter.meta.prevent="executeQuery"
126
- @keydown.enter.ctrl.prevent="executeQuery"
127
- @scroll="syncScroll"
128
- @input="syncScroll"
129
- />
130
-
131
- <!-- Cursor/Selection Overlay -->
132
- <div ref="cursorOverlay" class="absolute inset-0 pointer-events-none overflow-hidden">
133
- <!-- This will show cursor and selection -->
134
- </div>
135
- </div>
136
- </SplitterPanel>
137
- <SplitterResizeHandle
138
- id="splitter-group-2-resize-handle-1"
139
- class="h-[2px] bg-gray-200 hover:bg-indigo-300 dark:hover:bg-indigo-700"
140
- />
141
- <SplitterPanel id="splitter-group-2-panel-2" :min-size="40" class="border-t-2 border-gray-200 flex flex-col">
142
- <!-- Query Results Table -->
143
- <div v-if="isLoading" class="flex justify-center items-center h-full">
144
- <NLoading />
145
- </div>
146
-
147
- <div v-else-if="queryError" class="flex-1 flex flex-col overflow-hidden">
148
- <div
149
- class="px-3 py-2 flex justify-between items-center bg-gray-50 dark:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700 flex-shrink-0"
150
- >
151
- <NButton n="xs" icon="carbon:play" @click="executeQuery"> Execute Query </NButton>
152
- </div>
153
- <div class="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded">
154
- <div class="text-red-800 dark:text-red-200 font-medium">Query Error:</div>
155
- <div class="text-red-700 dark:text-red-300 text-sm mt-1">
156
- {{ queryError }}
157
- </div>
158
- </div>
159
- </div>
160
-
161
- <div
162
- v-else-if="currentTableRows && currentTableRows.length > 0"
163
- class="flex-1 flex flex-col overflow-hidden"
164
- >
165
- <!-- Results summary -->
166
- <div
167
- class="px-3 py-2 flex justify-between items-center bg-gray-50 dark:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700 flex-shrink-0"
168
- >
169
- <div class="flex items-center gap-3">
170
- <NButton n="xs green" icon="carbon:play" @click="executeQuery"> Execute Query </NButton>
171
-
172
- <div class="text-xs text-gray-600 dark:text-gray-400">
173
- {{ currentTableRows.length }} row{{ currentTableRows.length !== 1 ? "s" : "" }}
174
- returned
175
- </div>
176
- </div>
177
-
178
- <div class="flex items-center gap-1">
179
- <NButton
180
- n="xs"
181
- icon="carbon:chevron-left"
182
- :disabled="!table.getCanPreviousPage()"
183
- @click="table.previousPage()"
184
- />
185
-
186
- <!-- Page Jump Input -->
187
- <div class="flex items-center gap-1">
188
- <span class="text-xs text-gray-600 dark:text-gray-400">Page</span>
189
- <NTextInput
190
- v-model="currentPageInput"
191
- n="xs"
192
- class="w-12 text-center"
193
- type="number"
194
- min="1"
195
- :max="table.getPageCount()"
196
- @blur="jumpToPage"
197
- @keydown.enter="jumpToPage"
198
- />
199
- <span class="text-xs text-gray-600 dark:text-gray-400">of {{ table.getPageCount() }}</span>
200
- </div>
201
-
202
- <NButton
203
- n="xs"
204
- icon="carbon:chevron-right"
205
- :disabled="!table.getCanNextPage()"
206
- @click="table.nextPage()"
207
- />
208
- </div>
209
-
210
- <!-- Page Size Control -->
211
- <div class="flex items-center gap-1">
212
- <span class="text-xs text-gray-600 dark:text-gray-400">Show:</span>
213
- <NTextInput
214
- v-model="pageSizeInput"
215
- n="xs"
216
- class="w-16"
217
- type="number"
218
- min="1"
219
- max="1000"
220
- @blur="updatePageSize"
221
- @keydown.enter="updatePageSize"
222
- />
223
- <span class="text-xs text-gray-600 dark:text-gray-400">per page</span>
224
- </div>
225
- </div>
226
-
227
- <!-- Data Table -->
228
- <div class="flex-1 border border-gray-200 dark:border-neutral-700 rounded-b-lg overflow-auto">
229
- <table class="w-full min-w-max">
230
- <thead class="bg-gray-50 dark:bg-neutral-950 sticky top-0">
231
- <tr>
232
- <th
233
- v-for="header in table.getFlatHeaders()"
234
- :key="header.id"
235
- class="px-2 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 tracking-wider border-r border-gray-200 dark:border-neutral-700 last:border-r-0 relative overflow-hidden"
236
- :class="
237
- header.column.getCanSort() ? 'cursor-pointer hover:bg-gray-100 dark:hover:bg-neutral-700' : ''
238
- "
239
- :style="{
240
- width: `${header.getSize()}px`,
241
- maxWidth: `${header.getSize()}px`,
242
- minWidth: `${header.getSize()}px`
243
- }"
244
- @click="header.column.getToggleSortingHandler()?.($event)"
245
- >
246
- <div class="flex items-center gap-1 min-w-0">
247
- <div class="truncate flex-1 min-w-0">
248
- <FlexRender :render="header.column.columnDef.header" :props="header.getContext()" />
249
- </div>
250
- <span v-if="header.column.getIsSorted()" class="text-xs flex-shrink-0">
251
- {{ header.column.getIsSorted() === "asc" ? "\u25B2" : "\u25BC" }}
252
- </span>
253
- </div>
254
- <!-- Column Resize Handle -->
255
- <div
256
- v-if="header.column.getCanResize()"
257
- class="absolute top-0 right-0 h-full w-1 cursor-col-resize bg-transparent hover:bg-neutral-500 hover:bg-opacity-50 group"
258
- @mousedown="header.getResizeHandler()?.($event)"
259
- @touchstart="header.getResizeHandler()?.($event)"
260
- @click.stop
261
- >
262
- <div class="w-full h-full group-hover:bg-gray-500 transition-colors duration-150" />
263
- </div>
264
- </th>
265
- </tr>
266
- </thead>
267
- <tbody class="bg-white dark:bg-neutral-900 border-t border-gray-200 dark:border-neutral-700">
268
- <tr
269
- v-for="row in table.getRowModel().rows"
270
- :key="row.id"
271
- class="hover:bg-gray-50 dark:hover:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700"
272
- >
273
- <td
274
- v-for="cell in row.getVisibleCells()"
275
- :key="cell.id"
276
- class="px-2 py-3 text-sm text-gray-900 dark:text-gray-100 border-r border-gray-200 dark:border-neutral-700 last:border-r-0 overflow-hidden"
277
- :style="{
278
- width: `${cell.column.getSize()}px`,
279
- maxWidth: `${cell.column.getSize()}px`,
280
- minWidth: `${cell.column.getSize()}px`
281
- }"
282
- >
283
- <div class="truncate w-full" :title="String(cell.getValue())">
284
- <FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
285
- </div>
286
- </td>
287
- </tr>
288
- </tbody>
289
- </table>
290
- </div>
291
- </div>
292
-
293
- <div
294
- v-else-if="currentTableRows && currentTableRows.length === 0"
295
- class="flex-1 flex flex-col overflow-hidden"
296
- >
297
- <div
298
- class="px-3 py-2 flex justify-between items-center bg-gray-50 dark:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700 flex-shrink-0"
299
- >
300
- <NButton n="xs" icon="carbon:play" @click="executeQuery"> Execute Query </NButton>
301
- </div>
302
- <div class="text-center py-8">
303
- <div class="text-gray-500 dark:text-gray-400">No results found</div>
304
- </div>
305
- </div>
306
-
307
- <div v-else class="text-center py-8">
308
- <div class="text-gray-500 dark:text-gray-400">Execute a query to see results</div>
309
- </div>
310
- </SplitterPanel>
311
- </SplitterGroup>
312
- </SplitterPanel>
313
- </SplitterGroup>
314
- </div>
315
- </template>
316
-
317
- <script setup>
318
- import { usePowerSyncInspectorDiagnostics } from "#imports";
319
- import { SplitterGroup, SplitterPanel, SplitterResizeHandle, TreeItem, TreeRoot } from "reka-ui";
320
- import { asyncComputed } from "@vueuse/core";
321
- import {
322
- FlexRender,
323
- getCoreRowModel,
324
- useVueTable,
325
- getSortedRowModel,
326
- getPaginationRowModel
327
- } from "@tanstack/vue-table";
328
- import { ref, computed, watch, onMounted } from "vue";
329
- import { codeToHtml } from "shiki";
330
- import Fuse from "fuse.js";
331
- const ENTRIES_QUERY = `
332
- SELECT name, type
333
- FROM sqlite_schema
334
- WHERE type IN ('table', 'view')
335
- ORDER BY type, name;
336
- `;
337
- const { db } = usePowerSyncInspectorDiagnostics();
338
- const entriesRows = ref(null);
339
- const expandedItems = ref([]);
340
- const _tableInfo = ref(null);
341
- const treeData = computed(() => {
342
- if (!entriesRows.value) return [];
343
- const tables = entriesRows.value.filter((entry) => entry.type === "table");
344
- const views = entriesRows.value.filter((entry) => entry.type === "view");
345
- const treeItems = [];
346
- if (tables.length > 0) {
347
- treeItems.push({
348
- name: "Tables",
349
- type: "folder",
350
- icon: "carbon:folder",
351
- children: tables.map((table2) => ({
352
- ...table2,
353
- icon: "carbon:data-base"
354
- }))
355
- });
356
- }
357
- if (views.length > 0) {
358
- treeItems.push({
359
- name: "Views",
360
- type: "folder",
361
- icon: "carbon:view",
362
- children: views.map((view) => ({
363
- ...view,
364
- icon: "carbon:data-view"
365
- }))
366
- });
367
- }
368
- return treeItems;
369
- });
370
- const initializeFuse = () => {
371
- if (!entriesRows.value) return;
372
- const fuseOptions = {
373
- keys: ["name"],
374
- threshold: 0.3,
375
- // Adjust fuzzy search sensitivity (0 = exact, 1 = very fuzzy)
376
- includeScore: true,
377
- includeMatches: true
378
- };
379
- fuse.value = new Fuse(entriesRows.value, fuseOptions);
380
- };
381
- const filteredTreeData = computed(() => {
382
- if (!searchQuery.value || !fuse.value) {
383
- return treeData.value;
384
- }
385
- const searchResults = fuse.value.search(searchQuery.value);
386
- const filteredEntries = searchResults.map((result) => result.item);
387
- const tables = filteredEntries.filter((entry) => entry.type === "table");
388
- const views = filteredEntries.filter((entry) => entry.type === "view");
389
- const filteredTreeItems = [];
390
- if (tables.length > 0) {
391
- filteredTreeItems.push({
392
- name: "Tables",
393
- type: "folder",
394
- icon: "carbon:folder",
395
- children: tables.map((table2) => ({
396
- ...table2,
397
- icon: "carbon:data-base"
398
- }))
399
- });
400
- }
401
- if (views.length > 0) {
402
- filteredTreeItems.push({
403
- name: "Views",
404
- type: "folder",
405
- icon: "carbon:view",
406
- children: views.map((view) => ({
407
- ...view,
408
- icon: "carbon:data-view"
409
- }))
410
- });
411
- }
412
- return filteredTreeItems;
413
- });
414
- onMounted(async () => {
415
- entriesRows.value = await db.value.getAll(ENTRIES_QUERY);
416
- initializeFuse();
417
- });
418
- watch(entriesRows, () => {
419
- initializeFuse();
420
- });
421
- const onSearchInput = () => {
422
- expandedItems.value = ["Tables", "Views"];
423
- };
424
- const selectedEntry = ref(void 0);
425
- const query = ref("");
426
- const isLoading = ref(false);
427
- const queryError = ref(null);
428
- const _hasLimitOrOffset = ref(false);
429
- const currentTableRows = ref(null);
430
- const currentPageInput = ref("1");
431
- const pageSizeInput = ref("50");
432
- const searchQuery = ref("");
433
- const fuse = ref();
434
- const textareaRef = ref();
435
- const highlightContainer = ref();
436
- const cursorOverlay = ref();
437
- const columns = computed(() => {
438
- if (!currentTableRows.value || currentTableRows.value.length === 0) return [];
439
- const firstRow = currentTableRows.value[0];
440
- const dataColumns = Object.keys(firstRow);
441
- const columnsArray = [
442
- // Row number column (no header name)
443
- {
444
- id: "rowNumber",
445
- header: "",
446
- cell: ({ row }) => row.index + 1,
447
- size: 60,
448
- enableSorting: false,
449
- enableResizing: false
450
- },
451
- // Data columns
452
- ...dataColumns.map((key) => ({
453
- accessorKey: key,
454
- header: key,
455
- size: 150,
456
- minSize: 20,
457
- maxSize: 800,
458
- enableResizing: true,
459
- cell: ({ getValue }) => {
460
- const value = getValue();
461
- if (value === null) return "NULL";
462
- if (value === void 0) return "UNDEFINED";
463
- return String(value);
464
- }
465
- }))
466
- ];
467
- return columnsArray;
468
- });
469
- const table = useVueTable({
470
- get data() {
471
- return currentTableRows.value || [];
472
- },
473
- get columns() {
474
- return columns.value;
475
- },
476
- getCoreRowModel: getCoreRowModel(),
477
- getSortedRowModel: getSortedRowModel(),
478
- getPaginationRowModel: getPaginationRowModel(),
479
- enableColumnResizing: true,
480
- columnResizeMode: "onChange",
481
- defaultColumn: {
482
- size: 150,
483
- minSize: 20,
484
- maxSize: 800
485
- },
486
- initialState: {
487
- pagination: {
488
- pageSize: 50
489
- // Show 50 rows per page
490
- }
491
- }
492
- });
493
- const html = asyncComputed(
494
- async () => await codeToHtml(query.value, {
495
- lang: "sql",
496
- themes: {
497
- light: "catppuccin-latte",
498
- dark: "catppuccin-frappe"
499
- }
500
- })
501
- );
502
- const syncScroll = () => {
503
- if (textareaRef.value && highlightContainer.value) {
504
- highlightContainer.value.scrollTop = textareaRef.value.scrollTop;
505
- highlightContainer.value.scrollLeft = textareaRef.value.scrollLeft;
506
- }
507
- };
508
- const jumpToPage = () => {
509
- const pageNumber = Number.parseInt(currentPageInput.value, 10);
510
- if (pageNumber >= 1 && pageNumber <= table.getPageCount()) {
511
- table.setPageIndex(pageNumber - 1);
512
- } else {
513
- currentPageInput.value = String(table.getState().pagination.pageIndex + 1);
514
- }
515
- };
516
- const updatePageSize = () => {
517
- const pageSize = Number.parseInt(pageSizeInput.value, 10);
518
- if (pageSize >= 1 && pageSize <= 1e3) {
519
- table.setPageSize(pageSize);
520
- } else {
521
- pageSizeInput.value = String(table.getState().pagination.pageSize);
522
- }
523
- };
524
- watch(
525
- () => table.getState().pagination.pageIndex,
526
- (newPageIndex) => {
527
- currentPageInput.value = String(newPageIndex + 1);
528
- }
529
- );
530
- watch(
531
- () => table.getState().pagination.pageSize,
532
- (newPageSize) => {
533
- pageSizeInput.value = String(newPageSize);
534
- }
535
- );
536
- const selectEntry = (entry) => {
537
- selectedEntry.value = entry;
538
- query.value = `SELECT * FROM ${selectedEntry.value.name};`;
539
- executeQuery();
540
- };
541
- const executeQuery = async () => {
542
- if (!query.value.trim() || !db.value) return;
543
- isLoading.value = true;
544
- queryError.value = null;
545
- try {
546
- const result = await db.value.getAll(query.value);
547
- currentTableRows.value = result;
548
- } catch (error) {
549
- queryError.value = error instanceof Error ? error.message : "Unknown error occurred";
550
- currentTableRows.value = null;
551
- } finally {
552
- isLoading.value = false;
553
- }
554
- };
555
- watch(selectedEntry, () => {
556
- if (selectedEntry.value) {
557
- executeQuery();
558
- }
559
- });
560
- </script>
561
-
562
- <style>
563
- .syntax-highlight-bg{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:14px;line-height:1.5;margin:0;padding:.25rem 0 0}.syntax-highlight-bg pre{background:transparent!important;height:100%;overflow:visible}.syntax-highlight-bg code,.syntax-highlight-bg pre{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;padding:0}.syntax-highlight-bg code{counter-increment:step 0;counter-reset:step;display:block}.syntax-highlight-bg code .line:before{color:rgba(115,138,148,.4);content:counter(step);counter-increment:step;display:inline-block;margin-right:1.5rem;text-align:right;width:1rem}.dark .syntax-highlight-bg code .line:before{color:#d6cdcd}.editor-textarea{font-family:Monaco,Menlo,Ubuntu Mono,monospace!important;font-size:14px!important;line-height:1.5!important;margin:0!important;padding:.25rem 0 0 2.5rem!important;-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre;word-wrap:normal;box-sizing:border-box;caret-color:#2563eb!important;overflow-wrap:normal;scrollbar-width:thin}.dark .editor-textarea{caret-color:#60a5fa!important}.editor-textarea:focus{caret-color:#2563eb!important}.dark .editor-textarea:focus{caret-color:#60a5fa!important}.editor-textarea::-moz-selection{background-color:rgba(59,130,246,.3)}.editor-textarea::selection{background-color:rgba(59,130,246,.3)}.dark .editor-textarea::-moz-selection{background-color:rgba(96,165,250,.3)}.dark .editor-textarea::selection{background-color:rgba(96,165,250,.3)}.editor-textarea::-moz-placeholder{color:rgba(115,138,148,.6);font-family:inherit;font-size:inherit;line-height:inherit}.editor-textarea::placeholder{color:rgba(115,138,148,.6);font-family:inherit;font-size:inherit;line-height:inherit}
564
- </style>
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,12 +0,0 @@
1
- <template>
2
- <div class="loading-overlay">
3
- <div class="loading-content">
4
- <div class="spinner-icon"></div>
5
- <div class="loading-text">Loading...</div>
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <style scoped>
11
- .loading-overlay{align-items:center;background:#fff;display:flex;inset:0;justify-content:center;position:fixed;z-index:9999}@media (prefers-color-scheme:dark){.loading-overlay{background:#0a0a0a}.loading-text{color:hsla(0,0%,100%,.7)}}.loading-content{align-items:center;animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;display:flex;flex-direction:column;font-size:18px;gap:12px}.loading-text{color:rgba(0,0,0,.7)}.spinner-icon{animation:spin 1s linear infinite;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik03LjcgNC43YTE0LjcgMTQuNyAwIDAgMC0zIDMuMUw2LjMgOWExMy4zIDEzLjMgMCAwIDEgMi42LTIuN1ptLTMuMSA3LjYtMS45LS42QTEyLjUgMTIuNSAwIDAgMCAyIDE2aDJhMTEuNSAxMS41IDAgMCAxIC42LTMuN20tMS45IDguMWExNC40IDE0LjQgMCAwIDAgMiAzLjlsMS42LTEuMmExMi45IDEyLjkgMCAwIDEtMS43LTMuM1ptNS4xIDYuOWExNC40IDE0LjQgMCAwIDAgMy45IDJsLjYtMS45QTEyLjkgMTIuOSAwIDAgMSA5IDI1LjdabTMuOS0yNC42LjYgMS45QTExLjUgMTEuNSAwIDAgMSAxNiA0VjJhMTIuNSAxMi41IDAgMCAwLTQuMy43bTEyLjUgMjQuNmExNS4yIDE1LjIgMCAwIDAgMy4xLTMuMUwyNS43IDIzYTExLjUgMTEuNSAwIDAgMS0yLjcgMi43Wm0zLjItNy42IDEuOS42QTE1LjUgMTUuNSAwIDAgMCAzMCAxNmgtMmExMS41IDExLjUgMCAwIDEtLjYgMy43bTEuOC04LjFhMTQuNCAxNC40IDAgMCAwLTItMy45bC0xLjYgMS4yYTEyLjkgMTIuOSAwIDAgMSAxLjcgMy4zWm0tNS4xLTdhMTQuNCAxNC40IDAgMCAwLTMuOS0ybC0uNiAxLjlhMTIuOSAxMi45IDAgMCAxIDMuMyAxLjdabS0zLjggMjQuNy0uNi0xLjlhMTEuNSAxMS41IDAgMCAxLTMuNy42djJhMjEuNCAyMS40IDAgMCAwIDQuMy0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:contain;height:36px;opacity:.5;width:36px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{to{transform:rotate(1turn)}}
12
- </style>
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;