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:
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user