From 64f60cfa94d730ea5d6a9e7bc22a8d706f73d53c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 29 Apr 2021 09:05:42 +0200 Subject: Add support for SQLite ATTACH DATABASE functionality --- odb/sqlite/prepared-query.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'odb/sqlite/prepared-query.cxx') diff --git a/odb/sqlite/prepared-query.cxx b/odb/sqlite/prepared-query.cxx index ed63191..79df0f2 100644 --- a/odb/sqlite/prepared-query.cxx +++ b/odb/sqlite/prepared-query.cxx @@ -3,6 +3,8 @@ #include +#include + namespace odb { namespace sqlite @@ -11,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 (t.connection ()).main_connection () == + &static_cast (stmt->connection ()).main_connection (); + } } } -- cgit v1.1