You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Cloud SQL Connector for Python Drivers
2
-
**Warning**: This project is currently in _alpha_, and releases may contain breaking API changes.
2
+
**Warning**: This project is currently in _alpha_, and releases may contain breaking API changes.
3
3
4
4
The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL
5
5
database without having to manually allowlist IPs or manage SSL certificates.
**Note for SQL Server users**: If your SQL Server instance requires SSL, you need to download the CA certificate for your instance and include `cafile={path to downloaded certificate}` and `validate_host=False`. This is a workaround for a [known issue](https://issuetracker.google.com/184867147).
99
99
100
100
### Specifying Public or Private IP
101
-
The Cloud SQL Connector for Python can be used to connect to Cloud SQL instances using both public and private IP addresses. To specify which IP address to use to connect, set the `ip_type` keyword argument Possible values are `IPTypes.PUBLIC` and `IPTypes.PRIVATE`.
101
+
The Cloud SQL Connector for Python can be used to connect to Cloud SQL instances using both public and private IP addresses. To specify which IP address to use to connect, set the `ip_type` keyword argument Possible values are `IPTypes.PUBLIC` and `IPTypes.PRIVATE`.
102
102
Example:
103
103
```
104
104
connector.connect(
105
-
"project:region:instance",
105
+
"project:region:instance",
106
106
"pymysql",
107
107
ip_types=IPTypes.PRIVATE # Prefer private IP
108
108
... insert other kwargs ...
109
109
)
110
110
```
111
111
112
-
Note: If specifying Private IP, your application must already be in the same VPC network as your Cloud SQL Instance.
112
+
Note: If specifying Private IP, your application must already be in the same VPC network as your Cloud SQL Instance.
113
113
114
114
### IAM Authentication
115
-
Connections using [IAM database authentication](https://cloud.google.com/sql/docs/postgres/iam-logins) are supported when using the PostgreSQL driver.
115
+
Connections using [IAM database authentication](https://cloud.google.com/sql/docs/postgres/iam-logins) are supported when using the Postgres driver.
116
116
This feature is unsupported for other drivers.
117
-
First, make sure to [configure your Cloud SQL Instance to allow IAM authentication](https://cloud.google.com/sql/docs/postgres/create-edit-iam-instances#configure-iam-db-instance) and [add an IAM database user](https://cloud.google.com/sql/docs/postgres/create-manage-iam-users#creating-a-database-user).
118
-
Now, you can connect using user or service account credentials instead of a password.
117
+
First, make sure to [configure your Cloud SQL Instance to allow IAM authentication](https://cloud.google.com/sql/docs/postgres/create-edit-iam-instances#configure-iam-db-instance) and [add an IAM database user](https://cloud.google.com/sql/docs/postgres/create-manage-iam-users#creating-a-database-user).
118
+
Now, you can connect using user or service account credentials instead of a password.
119
119
In the call to connect, set the `enable_iam_auth` keyword argument to true and `user` to the email address associated with your IAM user.
120
120
Example:
121
121
```
@@ -131,7 +131,7 @@ connector.connect(
131
131
132
132
Tests can be run with `nox`. Change directory into the `cloud-sql-python-connector` and just run `nox` to run the tests.
133
133
134
-
1. Create a MySQL instance on Google Cloud SQL. Make sure to note your root password when creating the MySQL instance.
134
+
1. Create a MySQL instance on Google Cloud SQL. Make sure to note your root password when creating the MySQL instance.
135
135
2. When the MySQL instance has finished creating, go to the overview page and set the instance’s connection string to the environment variable MYSQL_CONNECTION_NAME using the following command:
0 commit comments