Skip to content

A local mock for testing applications that use Google Cloud SQL

License

Notifications You must be signed in to change notification settings

kloeckner-i/cloudish-sql

Repository files navigation

cloudish-sql

Cloudish-sql is a local mock for testing applications that use Google Cloud SQL. It partially implements the Cloud SQL Admin API and includes a mTLS proxy suitable for proxying requests to a local database backend.

Quickstart

Cloudish-sql will typically be used in conjunction with a PostgreSQL or MySQL container. This is best achieved with a tool such as docker-compose.

version: "3.6"
services:
  postgres:
    image: postgres:11-alpine
    environment:
      POSTGRES_PASSWORD: "test1234"

  cloudish-sql:
    build: .
    ports:
      - "127.0.0.1:3307:3307"
      - "127.0.0.1:8080:8080"
    environment:
      LOG_LEVEL: "INFO"
    command:
      - --db-address=postgres:5432

cloudish-sql will persist database information across requests in a filesystem based store. So between tests you will have to use unique ids or remove and restart the service.

Development

Prerequisites

Build

To build cloudish-sql, simply run make without any arguments.

The resulting binary will be written to: ./target/cloudish-sql.

make

Test

Before committing any code you should always lint and test your changes.

Code Linting

make lint

Running the Tests

make test