...
1# Cloud SQL proxy dialer for Go
2
3You can also use the Cloud SQL proxy directly from a Go program.
4
5These packages are primarily used as implementation for the Cloud SQL proxy
6command, and may be changed in backwards incompatible ways in the future.
7
8## Usage
9
10If your program is written in [Go](https://golang.org) you can use the Cloud SQL
11Proxy as a library, avoiding the need to start the Proxy as a companion process.
12
13Alternatively, there are Cloud SQL Connectors for [Java][] and [Python][].
14
15
16### MySQL
17
18If you're using the MySQL [go-sql-driver][go-mysql] you can use helper
19functions found in the [`proxy/dialers/mysql`][mysql-godoc]
20
21See [example usage](dialers/mysql/hook_test.go).
22
23### Postgres
24
25If you're using the Postgres [lib/pq](https://github.com/lib/pq), you can
26use the `cloudsqlpostgres` driver from [here](proxy/dialers/postgres).
27
28See [example usage](dialers/postgres/hook_test.go).
29
30[Java]: https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
31[Python]: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
32[go-mysql]: https://github.com/go-sql-driver/mysql
33[mysql-godoc]: https://pkg.go.dev/github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql
View as plain text