cornucopia-rs / cornucopia

Generate type-checked Rust from your PostgreSQL.
Other
755 stars 31 forks source link

Support BPCHAR #253

Open jacobsvante opened 1 week ago

jacobsvante commented 1 week ago

Getting this error for a CHAR(2) column:

  × Couldn't register SQL type.
   ╭─[./spotpilot-db/queries/site.sql:6:1]
 6 │ --
 7 │ --! select_one: DbSite
   ·     ─────┬────
   ·          ╰── this query contains an unsupported type (name: country, type: bpchar)
 8 │ SELECT

I guess this is because BPCHAR is not mentioned here: https://github.com/cornucopia-rs/cornucopia/blob/d1229ae6948e691c40e851377b9e5a410305ec4f/crates/cornucopia/src/type_registrar.rs#L374-L394