google-cloud-sql

Connect CloudSQL Postgres Db using Python

Connect CloudSQL Postgres Db using Python Question: So I am DevOps engineer please excuse for my lack of knowledge in python development. I am trying to connect a CloudSQL Postgres 14 Db using Python. So that I can insert data and read data from my application. Can someone help me understand why I am getting …

Total answers: 2

Connect to cloudSQL db using service account with pymysql or mysql.connector

Connect to cloudSQL db using service account with pymysql or mysql.connector Question: I have a running CloudSQL instance running in another VPC and a nginx proxy to allow cross-vpc access. I can access the db using a built-in user. But how can I access the DB using a Google Service Account? import google.auth import google.auth.transport.requests …

Total answers: 3

SQLAlchemy and Google Cloud Sql session pool

SQLAlchemy and Google Cloud Sql session pool Question: I am creating an async fastAPI microservice using graphql(strawberry). My database is hosted on GoogleCloudSQL and it is a postgres database. My microservice is working really good on local with local db but now when I built my connector to the GoogleCloudSQL it doesn’t work that well …

Total answers: 1

Airflow xcom pull only returns string

Airflow xcom pull only returns string Question: I have an airflow pipeline where I need to get a filename from a pubsub subscription and then import that file into a cloud sql instance. I use the CloudSqlInstanceImportOperator to import the CSV file. This operator needs a body, which contains the filename and other parameters. Since …

Total answers: 2

Start CloudSQL Proxy on Python Dataflow / Apache Beam

Start CloudSQL Proxy on Python Dataflow / Apache Beam Question: I am currently working on a ETL Dataflow job (using the Apache Beam Python SDK) which queries data from CloudSQL (with psycopg2 and a custom ParDo) and writes it to BigQuery. My goal is to create a Dataflow template which I can start from a …

Total answers: 3

Local MySQLdb connection fails with AttributeError for paramstyle when running GAE development server

Local MySQLdb connection fails with AttributeError for paramstyle when running GAE development server Question: I’m building a GAE Flask application with Flask-Alchemy, against Cloud SQL, and running dev_appserver to test the application as I build it. However, if I set the SQLALCHEMY_DATABASE_URI to a mysql+gaerdbms:///appname?instance=instanceid URL, I get the following traceback when trying to call …

Total answers: 1

Can SQLAlchemy be used with Google Cloud SQL?

Can SQLAlchemy be used with Google Cloud SQL? Question: I’ve looked over Google Cloud SQL’s documentation and various searches, but I can’t find out whether it is possible to use SQLAlchemy with Google Cloud SQL, and if so, what the connection URI should be. I’m looking to use the Flask-SQLAlchemy extension and need the connection …

Total answers: 5

Access Google Cloud SQL from python in local machine?

Access Google Cloud SQL from python in local machine? Question: Update 2022 There is cloud sql proxy now: https://cloud.google.com/sql/docs/mysql/sql-proxy#how-works Old Question I am currently using my local machine to manipulate data, google app engine to host my web service and google cloud sql to handle the database. However, I need to upload my data to …

Total answers: 3