aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/database.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/database.ixx')
-rw-r--r--odb/sqlite/database.ixx16
1 files changed, 16 insertions, 0 deletions
diff --git a/odb/sqlite/database.ixx b/odb/sqlite/database.ixx
index d5302a1..e906a39 100644
--- a/odb/sqlite/database.ixx
+++ b/odb/sqlite/database.ixx
@@ -14,6 +14,7 @@ namespace odb
database (database&& db) // Has to be inline.
: odb::database (std::move (db)),
name_ (std::move (db.name_)),
+ schema_ (std::move (db.schema_)),
flags_ (db.flags_),
foreign_keys_ (db.foreign_keys_),
vfs_ (std::move (db.vfs_)),
@@ -23,6 +24,21 @@ namespace odb
}
#endif
+ inline void database::
+ detach ()
+ {
+ if (!schema_.empty ())
+ static_cast<attached_connection_factory&> (*factory_).detach ();
+ }
+
+ inline database& database::
+ main_database ()
+ {
+ return schema_.empty ()
+ ? *this
+ : static_cast<attached_connection_factory&> (*factory_).main_connection_->database ();
+ }
+
inline connection_ptr database::
connection ()
{