mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-11 07:50:14 -04:00
* feat(asb + cli): Redact logs + unify tracing infrastructure (#1733) Applies the changes from https://github.com/comit-network/xmr-btc-swap/pull/1733 to this fork --------- Co-authored-by: Einliterflasche <81313171+Einliterflasche@users.noreply.github.com>
This commit is contained in:
parent
1fe6391b7b
commit
792fbbf746
20 changed files with 1780 additions and 1396 deletions
|
@ -4,8 +4,8 @@ use crate::protocol::{Database, State};
|
|||
use anyhow::{anyhow, Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use libp2p::{Multiaddr, PeerId};
|
||||
use sqlx::sqlite::Sqlite;
|
||||
use sqlx::{Pool, SqlitePool};
|
||||
use sqlx::sqlite::{Sqlite, SqliteConnectOptions};
|
||||
use sqlx::{ConnectOptions, Pool, SqlitePool};
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
use time::OffsetDateTime;
|
||||
|
@ -21,9 +21,16 @@ impl SqliteDatabase {
|
|||
Self: std::marker::Sized,
|
||||
{
|
||||
let path_str = format!("sqlite:{}", path.as_ref().display());
|
||||
let pool = SqlitePool::connect(&path_str).await?;
|
||||
|
||||
let mut options = SqliteConnectOptions::from_str(&path_str)?;
|
||||
|
||||
options.disable_statement_logging();
|
||||
|
||||
let pool = SqlitePool::connect_with(options).await?;
|
||||
let mut sqlite = Self { pool };
|
||||
|
||||
sqlite.run_migrations().await?;
|
||||
|
||||
Ok(sqlite)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue