feat: add Greenplum 7 compatibility and AI SQL generation

Greenplum 7 (PG12-based) compatibility:
- Auto-detect GP via version() string, store DbFlavor per connection
- connect returns ConnectResult with version + flavor
- Fix pg_total_relation_size to use c.oid (universal, safer on both PG/GP)
- Branch is_identity column query for GP (lacks the column)
- Branch list_sessions wait_event fields for GP
- Exclude gp_toolkit schema in schema listing, completion, lookup, AI context
- Smart StatusBar version display: GP shows "GP 7.0.0 (PG 12.4)"
- Fix connection list spinner showing on all cards during connect

AI SQL generation (Ollama):
- Add AI settings, model selection, and generate_sql command
- Frontend AI panel with prompt input and SQL output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 18:24:06 +03:00
parent d5cff8bd5e
commit e8d99c645b
27 changed files with 1276 additions and 113 deletions

View File

@@ -3,6 +3,16 @@ import { useConnections } from "@/hooks/use-connections";
import { Circle } from "lucide-react";
import { EnvironmentBadge } from "@/components/connections/EnvironmentBadge";
function formatDbVersion(version: string): string {
const gpMatch = version.match(/Greenplum Database ([\d.]+)/i);
if (gpMatch) {
const pgMatch = version.match(/^PostgreSQL ([\d.]+)/);
const pgVer = pgMatch ? ` (PG ${pgMatch[1]})` : "";
return `GP ${gpMatch[1]}${pgVer}`;
}
return version.split(",")[0]?.replace("PostgreSQL ", "PG ") ?? version;
}
interface Props {
rowCount?: number | null;
executionTime?: number | null;
@@ -46,7 +56,7 @@ export function StatusBar({ rowCount, executionTime }: Props) {
</span>
)}
{pgVersion && (
<span className="hidden sm:inline">{pgVersion.split(",")[0]?.replace("PostgreSQL ", "PG ")}</span>
<span className="hidden sm:inline">{formatDbVersion(pgVersion)}</span>
)}
</div>
<div className="flex items-center gap-3">