-
+ )}
+
+ {!useUrl && (
+ dbForm.type === "sqlite" ? (
+
+
+
handleDbInputChange("port", e.target.value)}
- className="h-9 text-sm font-mono"
+ placeholder="/path/to/database.db"
+ value={dbForm.database}
+ onChange={(e) => handleDbInputChange("database", e.target.value)}
+ className="h-9 text-sm font-mono flex-1"
/>
+
+ ) : (
+ <>
+
+
+
-
-
+
handleDbInputChange("user", e.target.value)}
+ placeholder="myapp"
+ value={dbForm.database}
+ onChange={(e) => handleDbInputChange("database", e.target.value)}
className="h-9 text-sm font-mono"
/>
-
-
-
handleDbInputChange("password", e.target.value)}
- className="h-9 text-sm"
+
+
+ handleDbInputChange("ssl", checked as boolean)}
/>
+
-
-
-
-
- handleDbInputChange("database", e.target.value)}
- className="h-9 text-sm font-mono"
- />
-
-
-
- handleDbInputChange("ssl", checked as boolean)}
- />
-
-
- >
+ >
+ )
)}
diff --git a/src/features/project/hooks/useDbQueries.ts b/src/features/project/hooks/useDbQueries.ts
index 13168b3..e70244b 100644
--- a/src/features/project/hooks/useDbQueries.ts
+++ b/src/features/project/hooks/useDbQueries.ts
@@ -228,6 +228,8 @@ export function useAddDatabase() {
onSuccess: () => {
// Invalidate and refetch database list
queryClient.invalidateQueries({ queryKey: queryKeys.databases });
+ queryClient.invalidateQueries({ queryKey: ["totalStats"] });
+ queryClient.invalidateQueries({ queryKey: ["connectionStatus"] });
},
});
}
@@ -259,6 +261,8 @@ export function useDeleteDatabase() {
mutationFn: (id: string) => databaseService.deleteDatabase(id),
onSuccess: (_, id) => {
queryClient.invalidateQueries({ queryKey: queryKeys.databases });
+ queryClient.invalidateQueries({ queryKey: ["totalStats"] });
+ queryClient.invalidateQueries({ queryKey: ["connectionStatus"] });
// Remove all cached data for this database
queryClient.removeQueries({ queryKey: queryKeys.tables(id) });
queryClient.removeQueries({ queryKey: queryKeys.stats(id) });
diff --git a/src/features/project/types.ts b/src/features/project/types.ts
index 02efbb4..ad38032 100644
--- a/src/features/project/types.ts
+++ b/src/features/project/types.ts
@@ -137,6 +137,7 @@ export interface ScanImportResult {
type?: string;
ssl?: boolean;
name?: string;
+ url?:string
} | null;
}