Skip to content

Commit 71bc993

Browse files
committed
Update SQL console query logic and clean up DynamicSchemaManager migration comments. Removed unnecessary runQueryOnce option and legacy migration code for clarity.
1 parent 136e93d commit 71bc993

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

tools/diagnostics-app/src/app/views/sql-console.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ function QueryHistoryContent({
4040
}: QueryHistoryDropdownProps) {
4141
const hasRestoredRef = React.useRef(false);
4242

43-
// useQuery reads from localStateDb (nested PowerSyncContext.Provider). runQueryOnce for local-only table.
43+
// useQuery reads from localStateDb (nested PowerSyncContext.Provider)
4444
const { data: historyData, isLoading } = useQuery<QueryHistoryEntry>(
4545
`SELECT id, query, executed_at FROM query_history ORDER BY executed_at DESC LIMIT ?`,
46-
[MAX_HISTORY],
47-
{ runQueryOnce: true }
46+
[MAX_HISTORY]
4847
);
4948
const queryHistory = historyData ?? [];
5049

tools/diagnostics-app/src/library/powersync/DynamicSchemaManager.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class DynamicSchemaManager {
2525

2626
/**
2727
* Load dynamic schema from local DB. Call after localStateDb is initialized (e.g. before connect).
28-
* One-time migration: if no row in app_settings, try localStorage (legacy) and persist to DB.
2928
*/
3029
async loadFromDb(): Promise<void> {
3130
const rows = await localStateDb.getAll<{ value: string }>(
@@ -36,19 +35,6 @@ export class DynamicSchemaManager {
3635
if (row?.value) {
3736
this.tables = JSON.parse(row.value);
3837
this.dirty = true;
39-
return;
40-
}
41-
// One-time migration from localStorage (schema was stored there before)
42-
try {
43-
const legacy = typeof localStorage !== 'undefined' && localStorage.getItem('powersync_dynamic_schema');
44-
if (legacy) {
45-
this.tables = JSON.parse(legacy);
46-
this.dirty = true;
47-
await this.persistSchema();
48-
localStorage.removeItem('powersync_dynamic_schema');
49-
}
50-
} catch {
51-
// ignore
5238
}
5339
}
5440

0 commit comments

Comments
 (0)