Skip to content

Commit

Permalink
dbcopy: make output nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jan 31, 2020
1 parent 9d5dc85 commit 0a18b2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions core/src/dird/dbcopy/database_column_descriptions.cc
Expand Up @@ -73,8 +73,7 @@ DatabaseColumnDescriptionsPostgresql::DatabaseColumnDescriptionsPostgresql(
query += table_name;
query += "'";

std::cout << "Collecting column descriptions for: " << table_name
<< std::endl;
std::cout << "--> " << table_name << std::endl;

SelectColumnDescriptions(query, ResultHandler);
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/dird/dbcopy/database_export_postgresql.cc
Expand Up @@ -114,7 +114,9 @@ static void UpdateSequences(
const DatabaseExportPostgresql::SequenceSchemaVector&
sequence_schema_vector)
{
std::cout << "Updating sequence for tables: " << std::endl;
for (const auto& s : sequence_schema_vector) {
std::cout << "--> " << s.table_name << std::endl;
std::string sequence_schema_query{"select setval(' "};
sequence_schema_query += s.sequence_name;
sequence_schema_query += "', (select max(";
Expand All @@ -126,7 +128,6 @@ static void UpdateSequences(
throw std::runtime_error(
"DatabaseExportPostgresql: Could not set sequence");
}
std::cout << "Updating sequence for table: " << s.table_name << std::endl;
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/dbcopy/database_import_mysql.cc
Expand Up @@ -95,7 +95,7 @@ void DatabaseImportMysql::RunQuerySelectAllRows(
{
for (const auto& t : table_descriptions_->tables) {
if (!exporter.StartTable(t.table_name)) {
std::cout << "--> skipping" << std::endl;
std::cout << "--> *** skipping ***" << std::endl;
continue;
}

Expand Down Expand Up @@ -198,7 +198,7 @@ void DatabaseImportMysql::FillRowWithDatabaseResult(ResultHandlerContext* r,
"Number of database fields does not match description");
}

RowData& row_data = r->row_data;
RowData& row_data = r->row_data;

if (r->is_restore_object) {
std::size_t field_index_longblob = fields - 1;
Expand Down
1 change: 1 addition & 0 deletions core/src/dird/dbcopy/database_table_descriptions.cc
Expand Up @@ -64,6 +64,7 @@ DatabaseTablesPostgresql::DatabaseTablesPostgresql(BareosDb* db)
std::vector<std::string> table_names;
SelectTableNames(query, table_names);

std::cout << "getting column descriptions..." << std::endl;
for (auto t : table_names) {
DatabaseColumnDescriptionsPostgresql p(db, t);
tables.emplace_back(std::move(t), std::move(p.column_descriptions));
Expand Down

0 comments on commit 0a18b2a

Please sign in to comment.