Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sea-orm-sync/src/database/db_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl ConnectionTrait for DatabaseConnection {
self.get_database_backend()
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn execute_raw(&self, stmt: Statement) -> Result<ExecResult, DbErr> {
super::tracing_spans::with_db_span!(
Expand Down Expand Up @@ -168,7 +168,7 @@ impl ConnectionTrait for DatabaseConnection {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
#[allow(unused_variables)]
fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
super::tracing_spans::with_db_span!(
Expand Down Expand Up @@ -212,7 +212,7 @@ impl ConnectionTrait for DatabaseConnection {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn query_one_raw(&self, stmt: Statement) -> Result<Option<QueryResult>, DbErr> {
super::tracing_spans::with_db_span!(
Expand Down Expand Up @@ -242,7 +242,7 @@ impl ConnectionTrait for DatabaseConnection {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn query_all_raw(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr> {
super::tracing_spans::with_db_span!(
Expand Down Expand Up @@ -291,7 +291,7 @@ impl StreamTrait for DatabaseConnection {
self.get_database_backend()
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn stream_raw<'a>(&'a self, stmt: Statement) -> Result<Self::Stream<'a>, DbErr> {
({
Expand Down
5 changes: 3 additions & 2 deletions sea-orm-sync/src/database/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl MockDatabase {
}

impl MockDatabaseTrait for MockDatabase {
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
fn execute(&mut self, counter: usize, statement: Statement) -> Result<ExecResult, DbErr> {
if let Some(transaction) = &mut self.transaction {
transaction.push(statement);
Expand All @@ -137,7 +137,7 @@ impl MockDatabaseTrait for MockDatabase {
}
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
fn query(&mut self, counter: usize, statement: Statement) -> Result<Vec<QueryResult>, DbErr> {
if let Some(transaction) = &mut self.transaction {
transaction.push(statement);
Expand Down Expand Up @@ -432,6 +432,7 @@ mod tests {
DbBackend, DbErr, IntoMockRow, MockDatabase, Statement, Transaction, TransactionError,
TransactionTrait, entity::*, error::*, tests_cfg::*,
};
use futures_util::TryStreamExt;
use pretty_assertions::assert_eq;

#[derive(Debug, PartialEq, Eq)]
Expand Down
10 changes: 5 additions & 5 deletions sea-orm-sync/src/database/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl ConnectionTrait for DatabaseTransaction {
self.backend
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn execute_raw(&self, stmt: Statement) -> Result<ExecResult, DbErr> {
debug_print!("{}", stmt);
Expand Down Expand Up @@ -372,7 +372,7 @@ impl ConnectionTrait for DatabaseTransaction {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
#[allow(unused_variables)]
fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
debug_print!("{}", sql);
Expand Down Expand Up @@ -431,7 +431,7 @@ impl ConnectionTrait for DatabaseTransaction {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn query_one_raw(&self, stmt: Statement) -> Result<Option<QueryResult>, DbErr> {
debug_print!("{}", stmt);
Expand Down Expand Up @@ -491,7 +491,7 @@ impl ConnectionTrait for DatabaseTransaction {
)
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
#[allow(unused_variables)]
fn query_all_raw(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug_print!("{}", stmt);
Expand Down Expand Up @@ -562,7 +562,7 @@ impl StreamTrait for DatabaseTransaction {
self.backend
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
fn stream_raw<'a>(&'a self, stmt: Statement) -> Result<Self::Stream<'a>, DbErr> {
({
#[cfg(not(feature = "sync"))]
Expand Down
8 changes: 4 additions & 4 deletions sea-orm-sync/src/driver/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl MockDatabaseConnection {
}

/// Execute the SQL statement in the [MockDatabase]
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr> {
debug_print!("{}", statement);
let counter = self.execute_counter.fetch_add(1, Ordering::SeqCst);
Expand All @@ -154,7 +154,7 @@ impl MockDatabaseConnection {
}

/// Return one [QueryResult] if the query was successful
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn query_one(&self, statement: Statement) -> Result<Option<QueryResult>, DbErr> {
debug_print!("{}", statement);
let counter = self.query_counter.fetch_add(1, Ordering::SeqCst);
Expand All @@ -167,7 +167,7 @@ impl MockDatabaseConnection {
}

/// Return all [QueryResult]s if the query was successful
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn query_all(&self, statement: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug_print!("{}", statement);
let counter = self.query_counter.fetch_add(1, Ordering::SeqCst);
Expand All @@ -178,7 +178,7 @@ impl MockDatabaseConnection {
}

/// Return [QueryResult]s from a multi-query operation
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn fetch(&self, statement: &Statement) -> PinBoxStream {
#[cfg(not(feature = "sync"))]
{
Expand Down
6 changes: 3 additions & 3 deletions sea-orm-sync/src/driver/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ impl ProxyDatabaseConnection {
}

/// Execute the SQL statement in the [ProxyDatabase]
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr> {
debug_print!("{}", statement);
Ok(self.proxy.execute(statement)?.into())
}

/// Return one [QueryResult] if the query was successful
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn query_one(&self, statement: Statement) -> Result<Option<QueryResult>, DbErr> {
debug_print!("{}", statement);
let result = self.proxy.query(statement)?;
Expand All @@ -77,7 +77,7 @@ impl ProxyDatabaseConnection {
}

/// Return all [QueryResult]s if the query was successful
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(statement))]
pub fn query_all(&self, statement: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug_print!("{}", statement);
let result = self.proxy.query(statement)?;
Expand Down
20 changes: 10 additions & 10 deletions sea-orm-sync/src/driver/rusqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl RusqliteSharedConnection {
}

/// Execute a [Statement] on a SQLite backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn execute(&self, stmt: Statement) -> Result<ExecResult, DbErr> {
debug!("{}", stmt);

Expand All @@ -333,7 +333,7 @@ impl RusqliteSharedConnection {
}

/// Execute an unprepared SQL statement on a SQLite backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
pub fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
debug!("{}", sql);

Expand All @@ -350,7 +350,7 @@ impl RusqliteSharedConnection {
}

/// Get one result from a SQL query. Returns [Option::None] if no match was found
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_one(&self, stmt: Statement) -> Result<Option<QueryResult>, DbErr> {
debug!("{}", stmt);

Expand All @@ -375,7 +375,7 @@ impl RusqliteSharedConnection {
}

/// Get the results of a query returning them as a Vec<[QueryResult]>
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_all(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug!("{}", stmt);

Expand All @@ -400,7 +400,7 @@ impl RusqliteSharedConnection {
}

/// Stream the results of executing a SQL query
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn stream(&self, stmt: Statement) -> Result<QueryStream, DbErr> {
debug!("{}", stmt);

Expand Down Expand Up @@ -481,7 +481,7 @@ impl RusqliteSharedConnection {
}

impl RusqliteInnerConnection {
#[instrument(level = "trace", skip(metric_callback))]
#[instrument(level = "trace", skip(metric_callback, stmt))]
pub fn execute(
&self,
stmt: Statement,
Expand All @@ -503,7 +503,7 @@ impl RusqliteInnerConnection {
})
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
pub(crate) fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
debug!("{}", sql);

Expand All @@ -518,7 +518,7 @@ impl RusqliteInnerConnection {
}
}

#[instrument(level = "trace", skip(metric_callback))]
#[instrument(level = "trace", skip(metric_callback, stmt))]
pub fn query_one(
&self,
stmt: Statement,
Expand All @@ -545,7 +545,7 @@ impl RusqliteInnerConnection {
})
}

#[instrument(level = "trace", skip(metric_callback))]
#[instrument(level = "trace", skip(metric_callback, stmt))]
pub fn query_all(
&self,
stmt: Statement,
Expand All @@ -572,7 +572,7 @@ impl RusqliteInnerConnection {
})
}

#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub(crate) fn stream(&self, stmt: &Statement) -> Result<Vec<QueryResult>, DbErr> {
debug!("{}", stmt);

Expand Down
10 changes: 5 additions & 5 deletions sea-orm-sync/src/driver/sqlx_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl SqlxMySqlConnector {

impl SqlxMySqlPoolConnection {
/// Execute a [Statement] on a MySQL backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn execute(&self, stmt: Statement) -> Result<ExecResult, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -144,7 +144,7 @@ impl SqlxMySqlPoolConnection {
}

/// Execute an unprepared SQL statement on a MySQL backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
pub fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
debug_print!("{}", sql);

Expand All @@ -156,7 +156,7 @@ impl SqlxMySqlPoolConnection {
}

/// Get one result from a SQL query. Returns [Option::None] if no match was found
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_one(&self, stmt: Statement) -> Result<Option<QueryResult>, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -174,7 +174,7 @@ impl SqlxMySqlPoolConnection {
}

/// Get the results of a query returning them as a Vec<[QueryResult]>
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_all(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -189,7 +189,7 @@ impl SqlxMySqlPoolConnection {
}

/// Stream the results of executing a SQL query
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn stream(&self, stmt: Statement) -> Result<QueryStream, DbErr> {
debug_print!("{}", stmt);

Expand Down
10 changes: 5 additions & 5 deletions sea-orm-sync/src/driver/sqlx_postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl SqlxPostgresConnector {

impl SqlxPostgresPoolConnection {
/// Execute a [Statement] on a PostgreSQL backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn execute(&self, stmt: Statement) -> Result<ExecResult, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -178,7 +178,7 @@ impl SqlxPostgresPoolConnection {
}

/// Execute an unprepared SQL statement on a PostgreSQL backend
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(sql))]
pub fn execute_unprepared(&self, sql: &str) -> Result<ExecResult, DbErr> {
debug_print!("{}", sql);

Expand All @@ -190,7 +190,7 @@ impl SqlxPostgresPoolConnection {
}

/// Get one result from a SQL query. Returns [Option::None] if no match was found
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_one(&self, stmt: Statement) -> Result<Option<QueryResult>, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -208,7 +208,7 @@ impl SqlxPostgresPoolConnection {
}

/// Get the results of a query returning them as a Vec<[QueryResult]>
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn query_all(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr> {
debug_print!("{}", stmt);

Expand All @@ -223,7 +223,7 @@ impl SqlxPostgresPoolConnection {
}

/// Stream the results of executing a SQL query
#[instrument(level = "trace")]
#[instrument(level = "trace", skip(stmt))]
pub fn stream(&self, stmt: Statement) -> Result<QueryStream, DbErr> {
debug_print!("{}", stmt);

Expand Down
Loading
Loading