mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
chore: cap sqlite preview rows
This commit is contained in:
@ -0,0 +1 @@
|
||||
export const PREVIEW_ROW_LIMIT = 1000
|
||||
@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user