diff --git a/db/migrations/mirror/000016_custom_types.up.sql b/db/migrations/mirror/000016_custom_types.up.sql new file mode 100644 index 000000000..84f220011 --- /dev/null +++ b/db/migrations/mirror/000016_custom_types.up.sql @@ -0,0 +1 @@ +create domain address as text; diff --git a/sqlc.yaml b/sqlc.yaml index 8461a4263..3ba7a7a24 100644 --- a/sqlc.yaml +++ b/sqlc.yaml @@ -290,6 +290,11 @@ sql: emit_db_tags: true emit_pointers_for_null_types: true overrides: + # DB type overrides. These are typically mappings from our own custom Postgres types to our own Go types, + # which allows us to use standard ::casts to specify query parameter types. + - db_type: 'address' + go_type: 'github.com/mikeydub/go-gallery/service/persist.Address' + # Overrides are prioritized from top to bottom, so if we need to override one of the * entries (like *.id), # the override should come _before_ the * entry # Users (and pii.user_view)