aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/prepared-query.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/prepared-query.cxx')
-rw-r--r--odb/sqlite/prepared-query.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/odb/sqlite/prepared-query.cxx b/odb/sqlite/prepared-query.cxx
index 6812b39..79df0f2 100644
--- a/odb/sqlite/prepared-query.cxx
+++ b/odb/sqlite/prepared-query.cxx
@@ -1,9 +1,10 @@
// file : odb/sqlite/prepared-query.cxx
-// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
#include <odb/sqlite/prepared-query.hxx>
+#include <odb/sqlite/connection.hxx>
+
namespace odb
{
namespace sqlite
@@ -12,5 +13,15 @@ namespace odb
~prepared_query_impl ()
{
}
+
+ bool prepared_query_impl::
+ verify_connection (odb::transaction& t)
+ {
+ // The transaction can be started using the main database of any of the
+ // attached databases. So we verify the main connections match.
+ //
+ return &static_cast<connection&> (t.connection ()).main_connection () ==
+ &static_cast<connection&> (stmt->connection ()).main_connection ();
+ }
}
}