Four new killer features leveraging AI (Ollama) and PostgreSQL internals: - Data Validation: describe quality rules in natural language, AI generates SQL to find violations, run with pass/fail results and sample violations - Test Data Generator: right-click table to generate realistic FK-aware test data with AI, preview before inserting in a transaction - Index Advisor: analyze pg_stat tables + AI recommendations for CREATE/DROP INDEX with one-click apply - Data Snapshots: export selected tables to JSON (FK-ordered), restore from file with optional truncate in a transaction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
872 B
TypeScript
39 lines
872 B
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
import {
|
|
generateValidationSql,
|
|
runValidationRule,
|
|
suggestValidationRules,
|
|
} from "@/lib/tauri";
|
|
|
|
export function useGenerateValidationSql() {
|
|
return useMutation({
|
|
mutationFn: ({
|
|
connectionId,
|
|
ruleDescription,
|
|
}: {
|
|
connectionId: string;
|
|
ruleDescription: string;
|
|
}) => generateValidationSql(connectionId, ruleDescription),
|
|
});
|
|
}
|
|
|
|
export function useRunValidationRule() {
|
|
return useMutation({
|
|
mutationFn: ({
|
|
connectionId,
|
|
sql,
|
|
sampleLimit,
|
|
}: {
|
|
connectionId: string;
|
|
sql: string;
|
|
sampleLimit?: number;
|
|
}) => runValidationRule(connectionId, sql, sampleLimit),
|
|
});
|
|
}
|
|
|
|
export function useSuggestValidationRules() {
|
|
return useMutation({
|
|
mutationFn: (connectionId: string) => suggestValidationRules(connectionId),
|
|
});
|
|
}
|