Datacol provides tight integration with cloud services like CloudSQL. It’s easy to create resources and manage them as a part of stack.
We only support MySQL (Second Generation) in alpha release.
How to create
To create a MySQL second generation resource, run
> datacol infra create mysql Creating mysql-31516 (mysql: activation_policy="ALWAYS" db_version="MYSQL_5_7" tier="db-g1-small" tier="db-n1-standard-1")
It will provision a managed MySQL instance, a database(
app) and an user with strong password.
||Name of the resource||
||database version to use||
||database machine type to use||
To get information and settings, run
> datacol infra info mysql-31516 mysql-42535 DATABASE_URL=mysql://mysql:firstname.lastname@example.org:3306/app INSTANCE_NAME=gcs-local:us-east1:mysql-42535
DATABASE_URL can act like DSN connection string to connect from various language drivers and frameworks if deployed with cloudsql-proxy.
How to link
To link a mysql/postgres resource to an app, run
datacol infra link like -
> datacol infra link mysql-31516
datacol infra link will provision cloudsql-proxy as a sidecar container along with your application in a pod with correct service account credentials.
How to unlink
To unlink a mysql/postgres resource from an app
> datacol infra unlink mysql-31516
How to delete
To delete a mysql/postgres resource from stack
> datacol infra delete mysql-31516