Skip to content

the trait bound bool: std::convert::From<std::option::Option<bool>> is not satisfied #4065

@FrenchGithubUser

Description

@FrenchGithubUser

I have found these related issues/pull requests

None

Description

         let rows = sqlx::query_as!(
            DBImportTorrent,
            r#"
            SELECT
                id,
                upload_factor,
                download_factor,
                seeders,
                leechers,
                times_completed,
                CASE
                    WHEN deleted_at IS NOT NULL THEN TRUE
                    ELSE FALSE
                END AS is_deleted
            FROM torrents
            "#
        )


#[derive(Debug)]
pub struct DBImportTorrent {
    pub id: i32,
    pub upload_factor: f64,
    pub download_factor: f64,
    pub seeders: i64,
    pub leechers: i64,
    pub times_completed: i32,
    pub is_deleted: bool,
} 

Throws this error: the trait bound bool: std::convert::From<std::option::Option<bool>> is not satisfied

Reproduction steps

Run the code above

SQLx version

0.8

Enabled SQLx features

"runtime-tokio", "tls-native-tls", "postgres", "chrono", "ipnetwork"

Database server and version

Postgres

Operating system

Asahi linux

Rust version

1.89.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions