aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/database.cxx
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.cxx
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.cxx')
-rw-r--r--odb/sqlite/database.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/odb/sqlite/database.cxx b/odb/sqlite/database.cxx
index e756608..6ce4621 100644
--- a/odb/sqlite/database.cxx
+++ b/odb/sqlite/database.cxx
@@ -27,8 +27,12 @@ namespace odb
database::
database (const string& name,
int flags,
+ bool foreign_keys,
auto_ptr<connection_factory> factory)
- : name_ (name), flags_ (flags), factory_ (factory)
+ : name_ (name),
+ flags_ (flags),
+ foreign_keys_ (foreign_keys),
+ factory_ (factory)
{
if (factory_.get () == 0)
factory_.reset (new connection_pool_factory ());
@@ -41,8 +45,9 @@ namespace odb
char* argv[],
bool erase,
int flags,
+ bool foreign_keys,
std::auto_ptr<connection_factory> factory)
- : flags_ (flags), factory_ (factory)
+ : flags_ (flags), foreign_keys_ (foreign_keys), factory_ (factory)
{
using namespace details;