feat: add Clone Database to Docker functionality

Clone any database to a local Docker PostgreSQL container with schema
and/or data transfer via pg_dump. Supports three modes: schema only,
full clone, and sample data. Includes container lifecycle management
(start/stop/remove) in the Admin panel, progress tracking with
collapsible process log, and automatic connection creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 19:27:16 +03:00
parent f68057beef
commit 1ce5f78de8
14 changed files with 1615 additions and 1 deletions

View File

@@ -16,6 +16,10 @@ pub struct ConnectionConfig {
impl ConnectionConfig {
pub fn connection_url(&self) -> String {
self.connection_url_for_db(&self.database)
}
pub fn connection_url_for_db(&self, database: &str) -> String {
let ssl = self.ssl_mode.as_deref().unwrap_or("prefer");
format!(
"postgres://{}:{}@{}:{}/{}?sslmode={}",
@@ -23,7 +27,7 @@ impl ConnectionConfig {
urlencoded(&self.password),
self.host,
self.port,
urlencoded(&self.database),
urlencoded(database),
ssl
)
}