mirror of https://github.com/django/django.git
Edited docs/db-api.txt changes from [5555]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5566 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6e1385b862
commit
64f20046f1
|
@ -1176,10 +1176,13 @@ database to add the full-text index.
|
||||||
regex
|
regex
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
|
**New in Django development version**
|
||||||
|
|
||||||
Case-sensitive regular expression match.
|
Case-sensitive regular expression match.
|
||||||
|
|
||||||
The regular expression syntax is that of the database backend in use; for the
|
The regular expression syntax is that of the database backend in use. In the
|
||||||
``sqlite`` backend, the syntax is that of Python's ``re`` module.
|
case of SQLite, which doesn't natively support regular-expression lookups, the
|
||||||
|
syntax is that of Python's ``re`` module.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
|
@ -1193,16 +1196,19 @@ SQL equivalents::
|
||||||
|
|
||||||
SELECT ... WHERE title ~ '^(An?|The) +'; -- PostgreSQL
|
SELECT ... WHERE title ~ '^(An?|The) +'; -- PostgreSQL
|
||||||
|
|
||||||
SELECT ... WHERE title REGEXP '^(An?|The) +'; -- sqlite
|
SELECT ... WHERE title REGEXP '^(An?|The) +'; -- SQLite
|
||||||
|
|
||||||
Using raw strings for passing in the regular expression syntax is recommended.
|
Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the
|
||||||
|
regular expression syntax is recommended.
|
||||||
|
|
||||||
Regular expression matching is not supported on the ``ado_mssql`` backend; it
|
Regular expression matching is not supported on the ``ado_mssql`` backend.
|
||||||
will raise a ``NotImplementedError``.
|
It will raise a ``NotImplementedError`` at runtime.
|
||||||
|
|
||||||
iregex
|
iregex
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
|
**New in Django development version**
|
||||||
|
|
||||||
Case-insensitive regular expression match.
|
Case-insensitive regular expression match.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -1217,7 +1223,7 @@ SQL equivalents::
|
||||||
|
|
||||||
SELECT ... WHERE title ~* '^(an?|the) +'; -- PostgreSQL
|
SELECT ... WHERE title ~* '^(an?|the) +'; -- PostgreSQL
|
||||||
|
|
||||||
SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- sqlite
|
SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- SQLite
|
||||||
|
|
||||||
Default lookups are exact
|
Default lookups are exact
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
Loading…
Reference in New Issue