Skip to content

Return query errors without closing client connections #14

@ignatz

Description

@ignatz

Summary

Whenever a query has an issue, the tokio_postgres connection is simply closed.

Instead I would expect the connection to remain open and healthy and the query produce a more specific query parse error.

Reproduction

Just put some rubbish here: https://github.com/f0rr0/pglite-oxide/blob/main/tests/client_compat.rs#L16, e.g.:

let row = client
    .query_one("FOO SELECT $1::int4 + 1 AS answer", &[&41_i32])
    .await
    .context("run tokio-postgres parameter query")?;

which will yield:

failures:

---- tokio_postgres_extended_query_works stdout ----
Error: run tokio-postgres parameter query

Caused by:
    connection closed


failures:
    tokio_postgres_extended_query_works

Versions

v0.3.0 and trunk. Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions