Skip to content

Commit

Permalink
feat: [sql] add Postgres Import/Export config messages (#5572)
Browse files Browse the repository at this point in the history
* feat: add Postgres Import/Export config messages

PiperOrigin-RevId: 655231833

Source-Link: googleapis/googleapis@51d7fa8

Source-Link: googleapis/googleapis-gen@95aaf66
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNxbC8uT3dsQm90LnlhbWwiLCJoIjoiOTVhYWY2NmVhYWJiZTI1OGIzMDkyYWY1OTBlYmY1NTc3YjE5MWMzMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 15, 2024
1 parent 7500af4 commit 4e3953a
Show file tree
Hide file tree
Showing 4 changed files with 837 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,20 @@ message ExportContext {
google.protobuf.Int32Value master_data = 1;
}

// Options for exporting from a Cloud SQL for PostgreSQL instance.
message PostgresExportOptions {
// Optional. Use this option to include DROP <object> SQL statements.
// These statements are used to delete database objects before running the
// import operation.
google.protobuf.BoolValue clean = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. Option to include an IF EXISTS SQL statement with each DROP
// statement produced by clean.
google.protobuf.BoolValue if_exists = 2
[(google.api.field_behavior) = OPTIONAL];
}

// Tables to export, or that were exported, from the specified database. If
// you specify tables, specify one and only one database. For PostgreSQL
// instances, you can specify only one table.
Expand All @@ -366,6 +380,10 @@ message ExportContext {
// Optional. Whether or not the export should be parallel.
google.protobuf.BoolValue parallel = 5
[(google.api.field_behavior) = OPTIONAL];

// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
PostgresExportOptions postgres_export_options = 6
[(google.api.field_behavior) = OPTIONAL];
}

// Options for exporting BAK files (SQL Server-only)
Expand Down Expand Up @@ -433,13 +451,29 @@ message ExportContext {
// Database instance import context.
message ImportContext {
message SqlImportOptions {
message PostgresImportOptions {
// Optional. The --clean flag for the pg_restore utility. This flag
// applies only if you enabled Cloud SQL to import files in parallel.
google.protobuf.BoolValue clean = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. The --if-exists flag for the pg_restore utility. This flag
// applies only if you enabled Cloud SQL to import files in parallel.
google.protobuf.BoolValue if_exists = 2
[(google.api.field_behavior) = OPTIONAL];
}

// Optional. The number of threads to use for parallel import.
google.protobuf.Int32Value threads = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. Whether or not the import should be parallel.
google.protobuf.BoolValue parallel = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
PostgresImportOptions postgres_import_options = 3
[(google.api.field_behavior) = OPTIONAL];
}

message SqlCsvImportOptions {
Expand Down
221 changes: 221 additions & 0 deletions packages/google-cloud-sql/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e3953a

Please sign in to comment.