Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BPCHAR #253

Open
jacobsvante opened this issue Jun 25, 2024 · 0 comments · May be fixed by #259
Open

Support BPCHAR #253

jacobsvante opened this issue Jun 25, 2024 · 0 comments · May be fixed by #259

Comments

@jacobsvante
Copy link
Contributor

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:

Kind::Simple => {
let (rust_name, is_copy) = match *ty {
Type::BOOL => ("bool", true),
Type::CHAR => ("i8", true),
Type::INT2 => ("i16", true),
Type::INT4 => ("i32", true),
Type::INT8 => ("i64", true),
Type::FLOAT4 => ("f32", true),
Type::FLOAT8 => ("f64", true),
Type::TEXT | Type::VARCHAR => ("String", false),
Type::BYTEA => ("Vec<u8>", false),
Type::TIMESTAMP => ("time::PrimitiveDateTime", true),
Type::TIMESTAMPTZ => ("time::OffsetDateTime", true),
Type::DATE => ("time::Date", true),
Type::TIME => ("time::Time", true),
Type::JSON | Type::JSONB => ("serde_json::Value", false),
Type::UUID => ("uuid::Uuid", true),
Type::INET => ("std::net::IpAddr", true),
Type::MACADDR => ("eui48::MacAddress", true),
Type::NUMERIC => ("rust_decimal::Decimal", true),
_ => {

@belohnung belohnung linked a pull request Oct 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant