diff --git a/ui/src/api.ts b/ui/src/api.ts index 0756526..9d0cd4b 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -3,6 +3,13 @@ import { createZodFetcher } from "zod-fetch"; const BASE_URL = import.meta.env.PROD ? "/api" : "http://localhost:3030/api"; +const counts = z + .object({ + name: z.string(), + count: z.number(), + }) + .array(); + const overview = z.object({ file_name: z.string(), sqlite_version: z.string().nullable(), @@ -21,21 +28,13 @@ const overview = z.object({ indexes: z.number(), triggers: z.number(), views: z.number(), - row_counts: z - .object({ - name: z.string(), - count: z.number(), - }) - .array(), + row_counts: counts, + column_counts: counts, + index_counts: counts, }); const tables = z.object({ - tables: z - .object({ - name: z.string(), - count: z.number(), - }) - .array(), + tables: counts, }); const table = z.object({ diff --git a/ui/src/routes/index.lazy.tsx b/ui/src/routes/index.lazy.tsx index 02daa19..5148994 100644 --- a/ui/src/routes/index.lazy.tsx +++ b/ui/src/routes/index.lazy.tsx @@ -139,6 +139,26 @@ function Index() { + +