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 {