use super::{PostgresAdapter, ReadRouting, numeric::PgNumericText};
use crate::{Result, types::JsonbValue};
pub async fn acquire_connection_with_retry(adapter: &PostgresAdapter) -> Result<()> {
adapter.acquire_connection_with_retry().await.map(drop)
}
pub async fn execute_raw(
adapter: &PostgresAdapter,
sql: &str,
routing: ReadRouting,
) -> Result<Vec<JsonbValue>> {
adapter.execute_raw(sql, &[], routing).await
}
pub fn mark_write(adapter: &PostgresAdapter) {
adapter.mark_write();
}
pub fn decode_numeric(
row: &tokio_postgres::Row,
column: &str,
) -> std::result::Result<String, tokio_postgres::Error> {
row.try_get::<_, PgNumericText>(column).map(|n| n.0)
}