aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/statement.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/statement.cxx')
-rw-r--r--odb/sqlite/statement.cxx39
1 files changed, 25 insertions, 14 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx
index da72d38..b1b0f58 100644
--- a/odb/sqlite/statement.cxx
+++ b/odb/sqlite/statement.cxx
@@ -1,5 +1,4 @@
// file : odb/sqlite/statement.cxx
-// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
#include <odb/tracer.hxx>
@@ -28,7 +27,7 @@ namespace odb
{
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->deallocate (conn_, *this);
@@ -56,27 +55,27 @@ namespace odb
{
active_ = false;
- string tmp;
+ string tmp1;
if (proc != 0)
{
switch (sk)
{
case statement_select:
- process_select (tmp,
+ process_select (tmp1,
text,
&proc->bind->buffer, proc->count, sizeof (bind),
'"', '"',
optimize);
break;
case statement_insert:
- process_insert (tmp,
+ process_insert (tmp1,
text,
&proc->bind->buffer, proc->count, sizeof (bind),
'?',
'$');
break;
case statement_update:
- process_update (tmp,
+ process_update (tmp1,
text,
&proc->bind->buffer, proc->count, sizeof (bind),
'?',
@@ -87,8 +86,20 @@ namespace odb
assert (false);
}
- text = tmp.c_str ();
- text_size = tmp.size ();
+ text = tmp1.c_str ();
+ text_size = tmp1.size ();
+ }
+
+ string tmp2;
+ if (conn_.statement_translator_ != 0)
+ {
+ conn_.statement_translator_ (tmp2, text, text_size, conn_);
+
+ if (!tmp2.empty ())
+ {
+ text = tmp2.c_str ();
+ text_size = tmp2.size ();
+ }
}
#if SQLITE_VERSION_NUMBER < 3005003
@@ -102,7 +113,7 @@ namespace odb
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
{
@@ -478,7 +489,7 @@ namespace odb
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->execute (conn_, *this);
@@ -619,7 +630,7 @@ namespace odb
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->execute (conn_, *this);
@@ -739,7 +750,7 @@ namespace odb
{
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->execute (conn_, *this);
@@ -846,7 +857,7 @@ namespace odb
{
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->execute (conn_, *this);
@@ -932,7 +943,7 @@ namespace odb
{
{
odb::tracer* t;
- if ((t = conn_.transaction_tracer ()) ||
+ if ((t = conn_.main_connection ().transaction_tracer ()) ||
(t = conn_.tracer ()) ||
(t = conn_.database ().tracer ()))
t->execute (conn_, *this);