refactor: extract sqlite constants

This commit is contained in:
yyh
2026-01-22 16:15:58 +08:00
parent b6228c99cd
commit e69163d072
2 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1 @@
export const TABLES_QUERY = 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name NOT LIKE \'sqlite_%\' ORDER BY name'

View File

@ -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<SQLiteQueryResult | null>
}
const TABLES_QUERY = 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name NOT LIKE \'sqlite_%\' ORDER BY name'
let sqliteClientPromise: Promise<SQLiteClient> | null = null
function createTempFileName(): string {