Add SQL statement logging
This commit is contained in:
parent
722f156b7d
commit
9390ae9821
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,8 @@ use crate::sql::statement::Statement;
|
||||||
use crate::sql::value::Value;
|
use crate::sql::value::Value;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
|
const NAME: &'static str = "surreal::exe";
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Executor {
|
pub struct Executor {
|
||||||
pub id: Option<String>,
|
pub id: Option<String>,
|
||||||
|
@ -53,6 +55,8 @@ impl Executor {
|
||||||
let mut opt = Options::new(&Auth::No);
|
let mut opt = Options::new(&Auth::No);
|
||||||
// Process all statements in query
|
// Process all statements in query
|
||||||
for stm in qry.statements().iter() {
|
for stm in qry.statements().iter() {
|
||||||
|
// Log the statement
|
||||||
|
debug!(target: NAME, "{}", stm);
|
||||||
// Reset errors
|
// Reset errors
|
||||||
if self.txn.is_none() {
|
if self.txn.is_none() {
|
||||||
self.err = None;
|
self.err = None;
|
||||||
|
|
Loading…
Reference in a new issue