diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-29 09:05:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-30 12:25:45 +0200 |
commit | 64f60cfa94d730ea5d6a9e7bc22a8d706f73d53c (patch) | |
tree | 1de8d43fa0da0ca9005c459461a8c303e74322ba /odb/sqlite/prepared-query.cxx | |
parent | fa3f14db14671b4c37c400880d097b17aa12b824 (diff) |
Add support for SQLite ATTACH DATABASE functionality
Diffstat (limited to 'odb/sqlite/prepared-query.cxx')
-rw-r--r-- | odb/sqlite/prepared-query.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
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 <odb/sqlite/prepared-query.hxx> +#include <odb/sqlite/connection.hxx> + 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<connection&> (t.connection ()).main_connection () == + &static_cast<connection&> (stmt->connection ()).main_connection (); + } } } |