Serge Bazanski | 35e8d79 | 2022-10-11 11:32:30 +0200 | [diff] [blame] | 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library") |
| 2 | load("//build/sqlc:sqlc.bzl", "sqlc_go_library") |
| 3 | |
| 4 | sqlc_go_library( |
| 5 | name = "sqlc_model", |
| 6 | dialect = "cockroachdb", |
| 7 | importpath = "source.monogon.dev/cloud/bmaas/bmdb/model", |
| 8 | migrations = glob(["migrations/*sql"]), |
| 9 | queries = [ |
| 10 | "queries.sql", |
| 11 | ], |
| 12 | ) |
| 13 | |
| 14 | go_library( |
| 15 | name = "model", |
| 16 | srcs = ["migrations.go"], |
| 17 | embed = [ |
| 18 | ":sqlc_model", # keep |
| 19 | ], |
| 20 | embedsrcs = glob(["migrations/*sql"]), |
| 21 | importpath = "source.monogon.dev/cloud/bmaas/bmdb/model", |
| 22 | visibility = ["//visibility:public"], |
| 23 | deps = [ |
| 24 | "@com_github_golang_migrate_migrate_v4//source", |
| 25 | "@com_github_golang_migrate_migrate_v4//source/iofs", |
| 26 | "@com_github_google_uuid//:uuid", # keep |
| 27 | ], |
| 28 | ) |