mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Add tracing to prepare() and query()
This commit is contained in:
parent
a447ea0f49
commit
5ebf51ae5a
1 changed files with 3 additions and 0 deletions
|
@ -19,6 +19,7 @@ use pager::Pager;
|
|||
use schema::Schema;
|
||||
use sqlite3_parser::{ast::Cmd, lexer::sql::Parser};
|
||||
use std::rc::Rc;
|
||||
use log::trace;
|
||||
|
||||
#[cfg(feature = "fs")]
|
||||
pub use io::PlatformIO;
|
||||
|
@ -92,6 +93,7 @@ pub struct Connection {
|
|||
impl Connection {
|
||||
pub fn prepare(&self, sql: impl Into<String>) -> Result<Statement> {
|
||||
let sql = sql.into();
|
||||
trace!("Preparing: {}", sql);
|
||||
let mut parser = Parser::new(sql.as_bytes());
|
||||
let cmd = parser.next()?;
|
||||
if let Some(cmd) = cmd {
|
||||
|
@ -110,6 +112,7 @@ impl Connection {
|
|||
|
||||
pub fn query(&self, sql: impl Into<String>) -> Result<Option<Rows>> {
|
||||
let sql = sql.into();
|
||||
trace!("Querying: {}", sql);
|
||||
let mut parser = Parser::new(sql.as_bytes());
|
||||
let cmd = parser.next()?;
|
||||
if let Some(cmd) = cmd {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue