You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
I got an error while I am trying to get data from column has type UUID
ColumnDecode { index: "request_id", source: AnyDriverError("Any driver does not support the Postgres type PgTypeInfo(Uuid)") }
My query use:
select request_id from tb_purchase
request_id is UUID type in PostgreSQL
Code block:
use super::trait_connection::IConnection;
use async_trait::async_trait;
use sqlx::{any::AnyRow, pool::PoolOptions, AnyPool};
#[derive(Debug)]
pub struct PostgresConnection {
pub database_url: String,
pub pool: Option<AnyPool>,
}
// ... code snippet
async fn query(&self, query: &str) -> Result<Vec<AnyRow>, String> {
let pool = self
.pool
.as_ref()
.ok_or("Database connection not established")?;
if query.is_empty() {
return Err("No query provided".to_string());
}
let rows = sqlx::query(query)
.fetch_all(pool)
.await
.map_err(|e| format!("Failed to query - {:?}", e))?;
Ok(rows)
}
Got error due to I am using AnyPool
When I replace AnyPool with PgPool, the system work normally. But I prefer using AnyPool because I am thinking of AnyPool can adapt to different DB types, instead of hardcoded to PostgreSQL
Minimal Reproduction
A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.
Info
SQLx version: [0.8.2]
Database server and version: ( Postgres <15.3>)
Operating system: Windows 10
rustc --version: [1.79.0]
The text was updated successfully, but these errors were encountered:
Bug Description
A clear and concise description of what the bug is.
I got an error while I am trying to get data from column has type UUID
ColumnDecode { index: "request_id", source: AnyDriverError("Any driver does not support the Postgres type PgTypeInfo(Uuid)") }
My query use:
select request_id from tb_purchase
request_id is UUID type in PostgreSQL
Code block:
Got error due to I am using AnyPool
When I replace AnyPool with PgPool, the system work normally. But I prefer using AnyPool because I am thinking of AnyPool can adapt to different DB types, instead of hardcoded to PostgreSQL
Minimal Reproduction
A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.
Info
rustc --version
: [1.79.0]The text was updated successfully, but these errors were encountered: