From e69163d0727b8deb81b088bf7b37ddc6c8beda36 Mon Sep 17 00:00:00 2001 From: yyh Date: Thu, 22 Jan 2026 16:15:58 +0800 Subject: [PATCH] refactor: extract sqlite constants --- web/app/components/workflow/skill/hooks/sqlite/constants.ts | 1 + web/app/components/workflow/skill/hooks/use-sqlite-database.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 web/app/components/workflow/skill/hooks/sqlite/constants.ts diff --git a/web/app/components/workflow/skill/hooks/sqlite/constants.ts b/web/app/components/workflow/skill/hooks/sqlite/constants.ts new file mode 100644 index 0000000000..3d54e4fa9e --- /dev/null +++ b/web/app/components/workflow/skill/hooks/sqlite/constants.ts @@ -0,0 +1 @@ +export const TABLES_QUERY = 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name NOT LIKE \'sqlite_%\' ORDER BY name' diff --git a/web/app/components/workflow/skill/hooks/use-sqlite-database.ts b/web/app/components/workflow/skill/hooks/use-sqlite-database.ts index 24eb055206..b0c8b30d85 100644 --- a/web/app/components/workflow/skill/hooks/use-sqlite-database.ts +++ b/web/app/components/workflow/skill/hooks/use-sqlite-database.ts @@ -7,6 +7,7 @@ import type { SQLiteVFS, } from './sqlite/types' import { useCallback, useEffect, useReducer, useRef } from 'react' +import { TABLES_QUERY } from './sqlite/constants' export type { SQLiteQueryResult, SQLiteValue } from './sqlite/types' @@ -17,8 +18,6 @@ export type UseSQLiteDatabaseResult = { queryTable: (tableName: string, limit?: number) => Promise } -const TABLES_QUERY = 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name NOT LIKE \'sqlite_%\' ORDER BY name' - let sqliteClientPromise: Promise | null = null function createTempFileName(): string {