taitan_orm/database/postgres/builder.rs
1use sqlx::postgres::PgConnectOptions;
2use sqlx::PgPool;
3use super::PostgresDatabase;
4pub struct PostgresBuilder {}
5
6impl PostgresBuilder {
7 pub async fn build(config: PgConnectOptions)-> crate::result::Result<PostgresDatabase> {
8 let pool = PgPool::connect_with(config).await?;
9
10 let database = PostgresDatabase {
11 pool,
12 };
13 Ok(database)
14 }
15}