use a2a_protocol_types::error::A2aError;
use sqlx::postgres::PgPoolOptions;
use sqlx::PgPool;
pub(super) async fn pg_pool(url: &str) -> Result<PgPool, sqlx::Error> {
pg_pool_with_size(url, 10).await
}
pub(super) async fn pg_pool_with_size(
url: &str,
max_connections: u32,
) -> Result<PgPool, sqlx::Error> {
PgPoolOptions::new()
.max_connections(max_connections)
.connect(url)
.await
}
#[allow(clippy::needless_pass_by_value)]
pub(in crate::store) fn to_a2a_error(e: sqlx::Error) -> A2aError {
A2aError::internal(format!("postgres error: {e}"))
}