@@ -611,7 +611,7 @@ namespace sqlite_orm {
611
611
}
612
612
613
613
backup_t make_backup_to (const std::string& filename) {
614
- auto holder = std::make_unique<connection_holder>(filename, nullptr );
614
+ auto holder = std::make_unique<connection_holder>(filename, nullptr , connection_control{} );
615
615
connection_ref conRef{*holder};
616
616
return {conRef, " main" , this ->get_connection (), " main" , std::move (holder)};
617
617
}
@@ -621,7 +621,7 @@ namespace sqlite_orm {
621
621
}
622
622
623
623
backup_t make_backup_from (const std::string& filename) {
624
- auto holder = std::make_unique<connection_holder>(filename, nullptr );
624
+ auto holder = std::make_unique<connection_holder>(filename, nullptr , connection_control{} );
625
625
connection_ref conRef{*holder};
626
626
return {this ->get_connection (), " main" , conRef, " main" , std::move (holder)};
627
627
}
@@ -642,6 +642,28 @@ namespace sqlite_orm {
642
642
return this ->connection ->retain_count () > 0 ;
643
643
}
644
644
645
+ /* *
646
+ * Return the name of the VFS object used by the database connection.
647
+ */
648
+ const std::string& vfs_name () const {
649
+ return this ->connection ->vfs_name ;
650
+ }
651
+
652
+ /* *
653
+ * Return the current open_mode for this storage object.
654
+ */
655
+ db_open_mode open_mode () const {
656
+ return this ->connection ->open_mode ;
657
+ }
658
+
659
+ /* *
660
+ * Return true if this database object is opened in a readonly state.
661
+ */
662
+ bool db_readonly () {
663
+ auto con = this ->get_connection ();
664
+ return static_cast <bool >(sqlite3_db_readonly (con.get (), " main" ));
665
+ }
666
+
645
667
/*
646
668
* returning false when there is a transaction in place
647
669
* otherwise true; function is not const because it has to call get_connection()
@@ -674,7 +696,8 @@ namespace sqlite_orm {
674
696
inMemory (filename.empty () || filename == " :memory:" ), isOpenedForever{connectionCtrl.open_forever },
675
697
connection (std::make_unique<connection_holder>(
676
698
std::move (filename),
677
- std::bind (&storage_base::on_open_internal, this , std::placeholders::_1))),
699
+ std::bind (&storage_base::on_open_internal, this , std::placeholders::_1),
700
+ connectionCtrl)),
678
701
cachedForeignKeysCount (foreignKeysCount) {
679
702
if (this ->inMemory ) {
680
703
this ->connection ->retain ();
0 commit comments