diff --git a/src/main.rs b/src/main.rs index 66c61da..b3141a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -646,7 +646,7 @@ mod sqlite { .map(|(name, count)| responses::Count { name, count }) .collect::>(); - counts.sort_by_key(|r| r.count); + counts.sort_by_key(|r| r.name.clone()); Ok(counts) }) @@ -1151,7 +1151,7 @@ mod libsql { .map(|(name, count)| responses::Count { name, count }) .collect::>(); - tables.sort_by_key(|r| r.count); + tables.sort_by_key(|r| r.name.clone()); Ok(responses::Tables { tables }) } @@ -1497,8 +1497,8 @@ mod postgres { .query_one( &format!( r#" - SELECT count(*) - FROM pg_indexes + SELECT count(*) + FROM pg_indexes WHERE schemaname = '{schema}' "# ), @@ -2394,8 +2394,8 @@ mod duckdb { let tables = tokio::task::spawn_blocking(move || { let tables: i32 = c.query_row( r#" - SELECT count(*) - FROM information_schema.tables + SELECT count(*) + FROM information_schema.tables WHERE table_schema = 'main' AND table_type = 'BASE TABLE' "#, [], @@ -2440,8 +2440,8 @@ mod duckdb { let tables: i32 = c.query_row( r#" - SELECT count(*) - FROM information_schema.tables + SELECT count(*) + FROM information_schema.tables WHERE table_schema = 'main' AND table_type = 'BASE TABLE' "#, [], @@ -2852,7 +2852,7 @@ mod clickhouse { r#" SELECT count(*) FROM system.columns - WHERE database = currentDatabase() + WHERE database = currentDatabase() AND (is_in_primary_key = true OR is_in_sorting_key = true) "#, ) @@ -2867,7 +2867,7 @@ mod clickhouse { r#" SELECT count(*) FROM system.tables - WHERE database = currentDatabase() + WHERE database = currentDatabase() AND engine = 'View' "#, ) @@ -2936,7 +2936,7 @@ mod clickhouse { r#" SELECT count(*) FROM system.columns - WHERE database = currentDatabase() + WHERE database = currentDatabase() AND table = ? AND (is_in_primary_key = true OR is_in_sorting_key = true) "#, @@ -3039,7 +3039,7 @@ mod clickhouse { r#" SELECT count(*) FROM system.columns - WHERE database = currentDatabase() + WHERE database = currentDatabase() AND table = ? AND (is_in_primary_key = true OR is_in_sorting_key = true) "#, diff --git a/ui/src/routeTree.gen.ts b/ui/src/routeTree.gen.ts index 16ec80c..4be1bc8 100644 --- a/ui/src/routeTree.gen.ts +++ b/ui/src/routeTree.gen.ts @@ -8,60 +8,60 @@ // This file is auto-generated by TanStack Router -import { createFileRoute } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router' // Import Routes -import { Route as rootRoute } from "./routes/__root"; +import { Route as rootRoute } from './routes/__root' // Create Virtual Routes -const TablesLazyImport = createFileRoute("/tables")(); -const QueryLazyImport = createFileRoute("/query")(); -const IndexLazyImport = createFileRoute("/")(); +const TablesLazyImport = createFileRoute('/tables')() +const QueryLazyImport = createFileRoute('/query')() +const IndexLazyImport = createFileRoute('/')() // Create/Update Routes const TablesLazyRoute = TablesLazyImport.update({ - path: "/tables", + path: '/tables', getParentRoute: () => rootRoute, -} as any).lazy(() => import("./routes/tables.lazy").then((d) => d.Route)); +} as any).lazy(() => import('./routes/tables.lazy').then((d) => d.Route)) const QueryLazyRoute = QueryLazyImport.update({ - path: "/query", + path: '/query', getParentRoute: () => rootRoute, -} as any).lazy(() => import("./routes/query.lazy").then((d) => d.Route)); +} as any).lazy(() => import('./routes/query.lazy').then((d) => d.Route)) const IndexLazyRoute = IndexLazyImport.update({ - path: "/", + path: '/', getParentRoute: () => rootRoute, -} as any).lazy(() => import("./routes/index.lazy").then((d) => d.Route)); +} as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route)) // Populate the FileRoutesByPath interface -declare module "@tanstack/react-router" { +declare module '@tanstack/react-router' { interface FileRoutesByPath { - "/": { - id: "/"; - path: "/"; - fullPath: "/"; - preLoaderRoute: typeof IndexLazyImport; - parentRoute: typeof rootRoute; - }; - "/query": { - id: "/query"; - path: "/query"; - fullPath: "/query"; - preLoaderRoute: typeof QueryLazyImport; - parentRoute: typeof rootRoute; - }; - "/tables": { - id: "/tables"; - path: "/tables"; - fullPath: "/tables"; - preLoaderRoute: typeof TablesLazyImport; - parentRoute: typeof rootRoute; - }; + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexLazyImport + parentRoute: typeof rootRoute + } + '/query': { + id: '/query' + path: '/query' + fullPath: '/query' + preLoaderRoute: typeof QueryLazyImport + parentRoute: typeof rootRoute + } + '/tables': { + id: '/tables' + path: '/tables' + fullPath: '/tables' + preLoaderRoute: typeof TablesLazyImport + parentRoute: typeof rootRoute + } } } @@ -71,7 +71,7 @@ export const routeTree = rootRoute.addChildren({ IndexLazyRoute, QueryLazyRoute, TablesLazyRoute, -}); +}) /* prettier-ignore-end */