use rustauth_core::db::{auth_schema, AuthSchemaOptions, DbAdapter, RateLimitStorage};
use rustauth_deadpool_postgres::DeadpoolPostgresStores;
#[tokio::main]
async fn main() -> Result<(), rustauth_core::error::RustAuthError> {
let schema = auth_schema(AuthSchemaOptions {
rate_limit_storage: RateLimitStorage::Database,
..AuthSchemaOptions::default()
});
let stores = DeadpoolPostgresStores::connect_with_schema_checked(
"postgres://user:password@localhost/rustauth",
schema.clone(),
)
.await?;
stores.adapter_ref().run_migrations(&schema).await?;
let _options = stores.apply_to_options(rustauth_core::options::RustAuthOptions::default());
Ok(())
}