aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/database.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-22 10:47:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-22 10:47:30 +0200
commit5a69eecefb4f5d29d7ab76f81e69ab27d85586cf (patch)
treec9b91104b4ec595ce836c95c561cf155fa647bea /odb/sqlite/database.hxx
parent5694c0a4529334756f2b914ad67408df199551dc (diff)
Enable foreign key constraints checking in SQLite
Due to bugs in SQLite DDL foreign key support, we have to temporarily disable foreign keys when re-creating the schema. New manual section: 12.5.3, "Foreign Key Constraints".
Diffstat (limited to 'odb/sqlite/database.hxx')
-rw-r--r--odb/sqlite/database.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/odb/sqlite/database.hxx b/odb/sqlite/database.hxx
index 0eadbbf..13c44e6 100644
--- a/odb/sqlite/database.hxx
+++ b/odb/sqlite/database.hxx
@@ -35,6 +35,7 @@ namespace odb
public:
database (const std::string& name,
int flags = SQLITE_OPEN_READWRITE,
+ bool foreign_keys = true,
std::auto_ptr<connection_factory> =
std::auto_ptr<connection_factory> (0));
@@ -56,6 +57,7 @@ namespace odb
char* argv[],
bool erase = false,
int flags = SQLITE_OPEN_READWRITE,
+ bool foreign_keys = true,
std::auto_ptr<connection_factory> =
std::auto_ptr<connection_factory> (0));
@@ -76,6 +78,12 @@ namespace odb
return flags_;
}
+ bool
+ foreign_keys () const
+ {
+ return foreign_keys_;
+ }
+
// Transactions.
//
public:
@@ -103,6 +111,7 @@ namespace odb
private:
std::string name_;
int flags_;
+ bool foreign_keys_;
std::auto_ptr<connection_factory> factory_;
};
}