Skip to content

How can I get a REAL field in sqlite as DECIMAL in Rust? #147

@Froidoh

Description

@Froidoh

Hola!

Defining my struct with:

pub price: rust_decimal::Decimal,

fails because

#[derive(Debug, Default, Clone, WeldsModel)]
| ^^^^^^^^^^ the trait sqlx::Type<sqlx::Sqlite> is not implemented for rust_decimal::Decimal

I have

sqlx = { version = "0.8.3", features = [
    "runtime-tokio-rustls", "sqlite", "rust_decimal"
  ]}

in my Cargo.toml though

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions