dbschema 0.1.2

Define database schema's as HCL files, and generate idempotent SQL migrations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
domain "email" {
  type = "text"
  check = "VALUE ~* '^[^@]+@[^@]+$'"
}

test "email_domain" {
  assert = [
    "SELECT 'user@example.com'::email IS NOT NULL"
  ]
  assert_fail = [
    "SELECT 'not-an-email'::email"
  ]
}