Skip to content

Commit 51d7fa8

Browse files
Google APIscopybara-github
authored andcommitted
feat: add Postgres Import/Export config messages
PiperOrigin-RevId: 655231833
1 parent e811b5e commit 51d7fa8

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

google/cloud/sql/v1/cloud_sql_resources.proto

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,20 @@ message ExportContext {
349349
google.protobuf.Int32Value master_data = 1;
350350
}
351351

352+
// Options for exporting from a Cloud SQL for PostgreSQL instance.
353+
message PostgresExportOptions {
354+
// Optional. Use this option to include DROP <object> SQL statements.
355+
// These statements are used to delete database objects before running the
356+
// import operation.
357+
google.protobuf.BoolValue clean = 1
358+
[(google.api.field_behavior) = OPTIONAL];
359+
360+
// Optional. Option to include an IF EXISTS SQL statement with each DROP
361+
// statement produced by clean.
362+
google.protobuf.BoolValue if_exists = 2
363+
[(google.api.field_behavior) = OPTIONAL];
364+
}
365+
352366
// Tables to export, or that were exported, from the specified database. If
353367
// you specify tables, specify one and only one database. For PostgreSQL
354368
// instances, you can specify only one table.
@@ -366,6 +380,10 @@ message ExportContext {
366380
// Optional. Whether or not the export should be parallel.
367381
google.protobuf.BoolValue parallel = 5
368382
[(google.api.field_behavior) = OPTIONAL];
383+
384+
// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
385+
PostgresExportOptions postgres_export_options = 6
386+
[(google.api.field_behavior) = OPTIONAL];
369387
}
370388

371389
// Options for exporting BAK files (SQL Server-only)
@@ -433,13 +451,29 @@ message ExportContext {
433451
// Database instance import context.
434452
message ImportContext {
435453
message SqlImportOptions {
454+
message PostgresImportOptions {
455+
// Optional. The --clean flag for the pg_restore utility. This flag
456+
// applies only if you enabled Cloud SQL to import files in parallel.
457+
google.protobuf.BoolValue clean = 1
458+
[(google.api.field_behavior) = OPTIONAL];
459+
460+
// Optional. The --if-exists flag for the pg_restore utility. This flag
461+
// applies only if you enabled Cloud SQL to import files in parallel.
462+
google.protobuf.BoolValue if_exists = 2
463+
[(google.api.field_behavior) = OPTIONAL];
464+
}
465+
436466
// Optional. The number of threads to use for parallel import.
437467
google.protobuf.Int32Value threads = 1
438468
[(google.api.field_behavior) = OPTIONAL];
439469

440470
// Optional. Whether or not the import should be parallel.
441471
google.protobuf.BoolValue parallel = 2
442472
[(google.api.field_behavior) = OPTIONAL];
473+
474+
// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
475+
PostgresImportOptions postgres_import_options = 3
476+
[(google.api.field_behavior) = OPTIONAL];
443477
}
444478

445479
message SqlCsvImportOptions {

0 commit comments

Comments
 (0)