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

Querying on views triggers a compile error #3192

Open
alexisgaziello opened this issue Apr 11, 2024 · 0 comments
Open

Querying on views triggers a compile error #3192

alexisgaziello opened this issue Apr 11, 2024 · 0 comments
Labels

Comments

@alexisgaziello
Copy link

alexisgaziello commented Apr 11, 2024

Bug Description

Cargo doesn't compile when using query_as! on postgres views.

I get errors for each column such as:

error[E0277]: the trait bound `$COLUMN_TYPE: From<std::option::Option<$COLUMN_TYPE>>` is not satisfied

Minimal Reproduction

Check this repo: https://github.com/alexisgaziello/sqlx-view/tree/main

The repo has a minimal code example:

fn not_working() {
    let _cars = sqlx::query_as!(
        Car,
        "SELECT id, created_at FROM active_car",
    );
}

... + the database setup

Info

  • SQLx version: [0.7.4]
  • SQLx features enabled: ["postgres", "runtime-tokio-native-tls", "macros", "uuid", "time", "chrono"]
  • Database server and version: [Postgres 14.4.0]
  • Operating system: [OS-X/Linux]
  • rustc --version: [rustc 1.76.0 (07dca489a 2024-02-04)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant