chore: full stack stability and migration fixes, plus react UI progress
Some checks failed
CI / podman-build (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-03-18 09:01:38 +02:00
parent 38cab8c246
commit a66d908eff
142 changed files with 12210 additions and 3402 deletions

View File

@@ -0,0 +1,21 @@
import { useQuery } from '@tanstack/react-query'
import { apiService, DbTable } from '../services/api'
export function useDatabase() {
const tablesQuery = useQuery({
queryKey: ['tables'],
queryFn: () => apiService.getTables().then(res => res.data),
})
const useTableData = (schema: string | null, name: string | null) => useQuery({
queryKey: ['tableData', schema, name],
queryFn: () => (schema && name) ? apiService.getTableData(schema, name).then(res => res.data) : Promise.resolve([]),
enabled: !!(schema && name),
})
return {
tables: tablesQuery.data || [],
isLoadingTables: tablesQuery.isLoading,
useTableData,
}
}