Skip to content

AnyQueryResult does not map last_insert_id correct #2982

Description

@thegenius

Bug Description

I found sqlx does not map QueryResult correctlly for postgres and sqlite

  1. PgQueryResult map last_insert_id to None
fn map_result(res: PgQueryResult) -> AnyQueryResult {
    AnyQueryResult {
        rows_affected: res.rows_affected(),
        last_insert_id: None,
    }
}
2. SqliteQueryResult map last_insert_id to None
```rust
fn map_result(res: SqliteQueryResult) -> AnyQueryResult {
    AnyQueryResult {
        rows_affected: res.rows_affected(),
        last_insert_id: None,
    }
}



### Minimal Reproduction



### Info
* SQLx version: [REQUIRED]
* SQLx features enabled: [REQUIRED]
* Database server and version: [REQUIRED] (MySQL / Postgres / SQLite <x.y.z>)
* Operating system: [REQUIRED]
* `rustc --version`: [REQUIRED]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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