-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support aiomysql (create_async_engine & async_creator) for async connector like postgress? #883
Comments
Hi @rjjan, thanks for asking a question on the Cloud SQL Python Connector 😄 Unfortunately the Cloud SQL Python Connector does not currently support the aiomysql library, thus it will not work the same as There is an open tracking issue #216 on our repo for its support. We also have a WIP PR open but it is blocked and has been blocked for a while on an aiomysql feature PR. If you are using a Cloud SQL instance with a Private IP you could connect directly with |
Really appreciate your answer. Unfortunately I am using public IP Cloud SQL instance. Seems that either I need to switch from mysql to postgress or to modify code to not using async engine. (a bit headache) Thanks |
@rjjan If you are using Public IP than you could deploy the Cloud SQL Proxy alongside your application and continue to use |
@jackwotherspoon It's an api service. I plan to deploy it to Cloud Run. Thanks again. |
@rjjan No penalty to using the Proxy other than a bit more configuration, the Cloud SQL Proxy is a language agnostic version of the Python Connector essentially. For Cloud Run I would recommend deploying the Cloud SQL Proxy as a sidecar using Cloud Run's multi-container feature. We have a Ruby example in our Cloud SQL Proxy repo that you can basically use the exact same YAML for your Python application. Just change the port to 3306 for MySQL and then you can have your Python application connect to your Cloud SQL instance via Hope this helps lay the ground work for you 😄 |
Going to close this as answered, feel free to re-open if issues persist 😄 |
Question
I use connector to Cloud SQL mysql
can i use aiomysql just like [asyncpg] (PostgreSQL)
just like
"Async Driver Usage" section in https://pypi.org/project/cloud-sql-python-connector/
Thank you
Code
No response
Additional Details
No response
The text was updated successfully, but these errors were encountered: