Add SQL statement logging

This commit is contained in:
Tobie Morgan Hitchcock 2022-01-20 23:06:58 +00:00
parent 722f156b7d
commit 9390ae9821

View file

@ -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;