chore: cap sqlite preview rows

This commit is contained in:
yyh
2026-01-22 16:37:33 +08:00
parent 808510746e
commit 6325a3458f
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
export const PREVIEW_ROW_LIMIT = 1000

View File

@ -1,5 +1,6 @@
import type { SQLiteQueryResult } from '../../hooks/sqlite/types'
import { useEffect, useReducer } from 'react'
import { PREVIEW_ROW_LIMIT } from './constants'
type TableState = {
data: SQLiteQueryResult | null
@ -71,7 +72,7 @@ export const useSQLiteTable = ({
dispatch({ type: 'loading' })
try {
const data = await queryTable(selectedTable)
const data = await queryTable(selectedTable, PREVIEW_ROW_LIMIT)
if (!cancelled)
dispatch({ type: 'success', data })
}