1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Macros that emit `tracing` events for queries and transactions.
//!
//! The macros expand to `tracing` calls when the *calling* crate has a
//! `tracing` feature enabled, and to nothing otherwise, so call sites need
//! no `#[cfg]`.
/// Emits a debug-level `drizzle.query` event with the SQL text and parameter
/// count.
///
/// # Examples
///
/// ```
/// let sql = "SELECT * FROM users WHERE id = ?";
/// drizzle_core::drizzle_trace_query!(sql, 1);
/// ```
/// Emits an info-level `drizzle.transaction` event for a transaction step
/// (`begin`, `commit`, `rollback`).
///
/// # Examples
///
/// ```
/// drizzle_core::drizzle_trace_tx!("begin", "sqlite.rusqlite");
/// drizzle_core::drizzle_trace_tx!("commit", "sqlite.rusqlite");
/// ```