feat(main): add silent mode to suppress output messages
* implement --silent flag to control output verbosity * update error handling to restore stderr after silent mode * enhance progress reporting in PostgreSQL reader
This commit is contained in:
@@ -1980,7 +1980,8 @@ func (w *Writer) executeDatabaseSQL(db *models.Database, connString string) erro
|
||||
Errors: make([]ExecutionError, 0),
|
||||
}
|
||||
|
||||
// Generate SQL statements
|
||||
// Generating a large schema can take time before any statement is executed.
|
||||
fmt.Fprintln(os.Stderr, " → Generating PostgreSQL statements...")
|
||||
statements, err := w.GenerateDatabaseStatements(db)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to generate SQL statements: %w", err)
|
||||
@@ -1989,12 +1990,14 @@ func (w *Writer) executeDatabaseSQL(db *models.Database, connString string) erro
|
||||
w.executionReport.TotalStatements = len(statements)
|
||||
|
||||
// Connect to database
|
||||
fmt.Fprintln(os.Stderr, " → Connecting to PostgreSQL output database...")
|
||||
ctx := context.Background()
|
||||
conn, err := pgsql.Connect(ctx, connString, "writer-pgsql")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to connect to database: %w", err)
|
||||
}
|
||||
defer conn.Close(ctx)
|
||||
fmt.Fprintln(os.Stderr, " → Connected. Executing statements...")
|
||||
|
||||
// Track schemas and tables
|
||||
schemaMap := make(map[string]*SchemaReport)
|
||||
|
||||
Reference in New Issue
Block a user