mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
025b55f7be
* chore: Initial database scaffolding This implements migrations and code generation for interfacing with a PostgreSQL database. A dependency is added for the "postgres" binary on the host, but that seems like an acceptable requirement considering it's our primary database. An in-memory database object can be created for simple cross-OS and fast testing. * Run tests in CI * Use Docker instead of binaries on the host * Skip database tests on non-Linux operating systems * chore: Add golangci-lint and codecov * Use consistent file names
21 lines
565 B
YAML
21 lines
565 B
YAML
# sqlc is used to generate types from sql schema language.
|
|
# It was chosen to ensure type-safety when interacting with
|
|
# the database.
|
|
version: "1"
|
|
packages:
|
|
- name: "database"
|
|
path: "."
|
|
queries: "./query.sql"
|
|
schema: "./dump.sql"
|
|
engine: "postgresql"
|
|
emit_interface: true
|
|
emit_json_tags: true
|
|
emit_db_tags: true
|
|
# We replace the generated db file with our own
|
|
# to add support for transactions. This file is
|
|
# deleted after generation.
|
|
output_db_file_name: db_tmp.go
|
|
overrides:
|
|
- db_type: citext
|
|
go_type: string
|