//! Main entrypoint. use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePool}; use std::str::FromStr; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { let subscriber = tracing_subscriber::fmt() .compact() // Use a more compact, abbreviated log format .with_file(true) // Display source code file paths .with_line_number(true) // Display source code line numbers .with_thread_ids(true) // Display the thread ID an event was recorded on .with_target(false) // Don't display the event's target (module path) .finish(); // Build the subscriber tracing::subscriber::set_global_default(subscriber)?; const NEGATION_ID: &str = "did:plc:"; // TODO: Argumentize this. let mut agent = atproto_teq::webrequest::Agent::default(); let pool_opts = SqliteConnectOptions::from_str("sqlite://prod.db").expect("Expected to be able to configure the database, but failed.") .journal_mode(SqliteJournalMode::Wal); let pool = SqlitePool::connect_with(pool_opts).await.expect("Expected to be able to connect to the database at sqlite://prod.db but failed."); atproto_teq::database::negation(NEGATION_ID, &mut agent, &pool).await?; Ok(()) }