plugin: Add a new importer/exporter type for Google Cloud.#2
Merged
Conversation
* Adds a new importer/exporter prototype, mysql+gce that uses the Cloud SQL proxy in order to make connection more user friendly. * It works at two level, first by registering a new sql Driver for any database/sql usage. And then for mysqldump/mysqlimport it uses the library to dial to a localhost:$RANDOMPORT and points the binary to this.
dd3968d to
e528c7a
Compare
omar-polo
approved these changes
Apr 29, 2026
brmzkw
approved these changes
Apr 29, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new MySQL connector variant intended for Google Cloud SQL by introducing proxy-backed importer/exporter binaries and extending connection handling to support a Cloud SQL dialer/proxy path.
Changes:
- Add new
mysql-proxy-importer/mysql-proxy-exporterplugin binaries and register protocolmysql+gcsql. - Extend
mysqlconn.ConnConfig/ParseConnConfigto optionally set up a Cloud SQL proxy and add a Cloud SQL DSN path fordatabase/sql. - Update build/test Dockerfiles, Makefile, manifest, and docs to include the new binaries/protocol.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/plakar-mysql.Dockerfile | Builds the new proxy plugin binaries into the test image and adjusts source path. |
| tests/plakar-mariadb.Dockerfile | Same as above for the MariaDB test image build context. |
| plugin/mysql-proxy-importer/mysql-proxy-importer.go | New importer entrypoint using ParseConnConfig(true, ...) for Cloud SQL proxy mode. |
| plugin/mysql-proxy-exporter/mysql-proxy-exporter.go | New exporter entrypoint using ParseConnConfig(true, ...) for Cloud SQL proxy mode. |
| plugin/mysql-importer/mysql-importer.go | Updates ParseConnConfig call signature for non-proxy mode. |
| plugin/mysql-exporter/mysql-exporter.go | Updates ParseConnConfig call signature for non-proxy mode. |
| plugin/mariadb-importer/mariadb-importer.go | Updates ParseConnConfig call signature for non-proxy mode. |
| plugin/mariadb-exporter/mariadb-exporter.go | Updates ParseConnConfig call signature for non-proxy mode. |
| mysqlconn/conn.go | Implements proxy setup + Cloud SQL DSN generation and flags on ConnConfig. |
| manifest/metadata.go | Switches openDB to use a different DSN/driver when SqlCloud is enabled. |
| manifest.yaml | Registers the new importer/exporter and protocol mysql+gcsql. |
| go.mod | Adds Cloud SQL connector dependency and updates module versions / Go version directive. |
| go.sum | Updates sums for new and upgraded dependencies. |
| README.md | Documents mysql+gcsql:// protocol and intended behavior. |
| Makefile | Builds/cleans the new proxy binaries. |
| .gitignore | Ignores newly built proxy binaries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new importer/exporter prototype, mysql+gcsql that uses the Cloud SQL proxy in order to make connection more user friendly.
It works at two level, first by registering a new sql Driver for any database/sql usage. And then for mysqldump/mysqlimport it uses the library to dial to a localhost:$RANDOMPORT and points the binary to this.