diff options
author | Tobias Koenig <tobias.koenig@kdab.com> | 2013-10-28 09:25:11 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-04 09:52:36 +0100 |
commit | 1f6dfa774959830a915f3e2a7b0561ca29b8c485 (patch) | |
tree | 952b5fcdc0cf6984bebdd2aae4b06b844bf4564e /src | |
parent | 3b48a65e99839c9427923c03b4e2a87a8465d165 (diff) |
Add QSQLITE_OPEN_URI database connection flag
This flag enables the URI mode for database names in the SQLite
backend. Without this flag, it's not possible to use URIs like
'file:somedb?mode=memory&cache=shared'
to create shared, in-memory databases.
Change-Id: I2938184dad1f27c7af454385ca305bd4f6ed1a5e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'src')
-rw-r--r-- | src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 | ||||
-rw-r--r-- | src/sql/kernel/qsqldatabase.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index ffeb7921b3..0a8b71aa8a 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -596,6 +596,8 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c } if (option == QLatin1String("QSQLITE_OPEN_READONLY")) openMode = SQLITE_OPEN_READONLY; + if (option == QLatin1String("QSQLITE_OPEN_URI")) + openMode |= SQLITE_OPEN_URI; if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) sharedCache = true; } diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index b87a1fe1c5..f8ecabee8f 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -1264,6 +1264,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const \list \li QSQLITE_BUSY_TIMEOUT \li QSQLITE_OPEN_READONLY + \li QSQLITE_OPEN_URI \li QSQLITE_ENABLE_SHARED_CACHE \endlist |