diff options
Diffstat (limited to 'src/sql/doc')
-rw-r--r-- | src/sql/doc/snippets/code/doc_src_sql-driver.cpp | 5 | ||||
-rw-r--r-- | src/sql/doc/src/sql-driver.qdoc | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp index f25ad4f2b0..7983386642 100644 --- a/src/sql/doc/snippets/code/doc_src_sql-driver.cpp +++ b/src/sql/doc/snippets/code/doc_src_sql-driver.cpp @@ -90,3 +90,8 @@ qDebug() << q.value(0); // outputs the first RETURN/OUT value QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QMYSQL //! [31] + + +//! [34] +column.contains(QRegularExpression("pattern")); +//! [34] diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc index 4f3f2ce007..2811230106 100644 --- a/src/sql/doc/src/sql-driver.qdoc +++ b/src/sql/doc/src/sql-driver.qdoc @@ -568,6 +568,22 @@ \snippet code/doc_src_sql-driver.qdoc 23 + \section3 Enable REGEXP operator + + SQLite comes with a REGEXP operation. However the needed implementation must + be provided by the user. For convenience a default implementation can be + enabled by \l{QSqlDatabase::setConnectOptions()} {setting the connect + option} \c{QSQLITE_ENABLE_REGEXP} before \l{QSqlDatabase::open()} {the + database connection is opened}. Then a SQL statement like "column REGEXP + 'pattern'" basically expands to the Qt code + + \snippet code/doc_src_sql-driver.cpp 34 + + For better performance the regular expressions are cached internally. By + default the cache size is 25, but it can be changed through the option's + value. For example passing "\c{QSQLITE_ENABLE_REGEXP=10}" reduces the + cache size to 10. + \section3 QSQLITE File Format Compatibility SQLite minor releases sometimes break file format forward compatibility. |