Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Has been skipped
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 9m0s
Podman Rootless Demo / deploy-prod (push) Has been skipped
Podman Rootless Demo / test-backend (pull_request) Has been skipped
Podman Rootless Demo / test-frontend (pull_request) Has been skipped
Podman Rootless Demo / build-backend (pull_request) Has been skipped
Podman Rootless Demo / build-frontend (pull_request) Failing after 8m29s
Podman Rootless Demo / deploy-prod (pull_request) Has been skipped
20 lines
No EOL
816 B
Rust
20 lines
No EOL
816 B
Rust
use anyhow::Result;
|
|
use clap::Parser;
|
|
use postgres::{PostgresUserService, PostgresProductService};
|
|
use cli::Cli;
|
|
use utils::HubConfig;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
dotenvy::from_path("config/cli-postgres.env").ok();
|
|
|
|
// Load and validate hub universe DID from environment file
|
|
let hub_universe_did = HubConfig::read_default_hub_universe_did_from_file("config/cli-postgres.env")?;
|
|
|
|
let pool = sqlx::PgPool::connect(&std::env::var("DATABASE_URL")?).await?;
|
|
let user_service = PostgresUserService::new(postgres::PostgresUserRepository::new(pool.clone()));
|
|
let product_service = PostgresProductService::new(postgres::PostgresProductRepository::new(pool));
|
|
|
|
let cli = Cli::try_parse()?;
|
|
cli.run(user_service, product_service, hub_universe_did.did().to_string()).await
|
|
}
|