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>
This commit is contained in:
Tobias Koenig 2013-10-28 09:25:11 +01:00 committed by The Qt Project
parent 3b48a65e99
commit 1f6dfa7749
3 changed files with 4 additions and 0 deletions

1
dist/changes-5.2.0 vendored
View File

@ -148,6 +148,7 @@ Changes in Qt 5.1.0 (missing from released changelog dist/changes-5.1.0)
Changes in Qt 5.2.0
- [QTBUG-29261] IBASE: Construct a valid QTime when creating timestamps for iBase SQL driver.
- [QTBUG-33389] PSQL: Format QDateTime following ISO8601.
- Add QSQLITE_OPEN_URI option to QSQLITE driver
****************************************************************************
* Platform Specific Changes *

View File

@ -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;
}

View File

@ -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