aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/connection.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-10-02 08:29:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-10-02 08:46:39 +0200
commit275f4e494cacd403d28b01f8e3356a6669ef8e13 (patch)
treea5ace7d893a5ff335038e5db9f72d4cf33bd60d5 /odb/sqlite/connection.cxx
parent29f048816a31422685c44085ac20e45d97f95ecf (diff)
Add support for SQLite 3.3.6
That's what is still shipped with RHEL5.
Diffstat (limited to 'odb/sqlite/connection.cxx')
-rw-r--r--odb/sqlite/connection.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/odb/sqlite/connection.cxx b/odb/sqlite/connection.cxx
index f4e7259..188d59f 100644
--- a/odb/sqlite/connection.cxx
+++ b/odb/sqlite/connection.cxx
@@ -51,12 +51,22 @@ namespace odb
f |= SQLITE_OPEN_NOMUTEX;
#endif
- const string& vfs (db.vfs ());
-
sqlite3* h (0);
+
+ // sqlite3_open_v2() was only addedin SQLite 3.5.0.
+ //
+#if SQLITE_VERSION_NUMBER >= 3005000
+ const string& vfs (db.vfs ());
int e (
sqlite3_open_v2 (
n.c_str (), &h, f, (vfs.empty () ? 0 : vfs.c_str ())));
+#else
+ // Readonly opening not supported in SQLite earlier than 3.5.0.
+ //
+ assert ((f & SQLITE_OPEN_READONLY) == 0);
+ int e (sqlite3_open (n.c_str (), &h));
+#endif
+
handle_.reset (h);
if (e != SQLITE_OK)