Skip to content

no rows returned by a query that expected to return at least one row could be caught at compile-time #4137

@FrenchGithubUser

Description

@FrenchGithubUser

I have found these related issues/pull requests

none

Description

this query:

sqlx::query!(
            r#"
            INSERT INTO user_edit_change_logs (item_type, item_id, edited_by_id, edits)
            VALUES ($1, $2, $3, $4)
            "#,
            log.item_type,
            log.item_id,
            log.edited_by_id,
            log.edits
        )
        .fetch_one(...)

doesn't return anything, yet there will be an error at runtime because fetch_one() expects something returned. Couldn't this be caught at compile-time?

Prefered solution

.

Is this a breaking change? Why or why not?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions