Django

Code

Ticket #6047 (closed: fixed)

Opened 2 years ago

Last modified 6 months ago

db-api docs: invalid REGEX SQL equiv for SQLite

Reported by: Richard D. Worth <rdworth@gmail.com> Assigned to: holdenweb
Milestone: Component: Documentation
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by mtredinnick)

On the documentation/db-api/ page, under REGEX, the following

"In the case of SQLite, which doesn’t natively support regular-expression lookups, the syntax is that of Python’s re module."

doesn't match this line

SQL equivalents:

SELECT ... WHERE title REGEXP '^(An?|The) +'; -- SQLite

This should be removed, or a SQL + pythen re equiv should be put in its place.

Attachments

6047.diff (0.7 kB) - added by holdenweb on 04/13/08 09:33:24.
Fix minor nit with SQLite regexp documentation
6047.2.diff (0.8 kB) - added by timo on 07/16/09 18:08:52.
update patch to apply to trunk

Change History

12/01/07 19:47:53 changed by Simon G <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs set to 1.

12/02/07 13:50:31 changed by mtredinnick

  • description changed.

12/02/07 13:55:28 changed by mtredinnick

It's not entirely clear to me what the problem is you're pointing out here. Given that we don't want to remove the line, could you suggest an alternative formulation (it's a balance between acknowledging that SQLite actually uses Python to do some of the heavy lifting here, without bogging the documentation down in relatively minor details at this point). Any suggestions on what we could do to make it clearer?

12/03/07 05:24:17 changed by Richard D. Worth <rdworth@gmail.com>

It doesn't seem to me correct or useful to list a SQLite SQL equivalent if there isn't one.

If you're going to leave it, my suggestion would be to move the line

"In the case of SQLite, which doesn’t natively support regular-expression lookups, the syntax is that of Python’s re module."

to directly below the code block of SQL equivs. This would put the two lines closer together, reducing the chance that someone would see the SQLite example without the accompanying/qualifying note (especially as a similar equiv appears in IREGEX, relying on this note for clarification)

Perhaps format it as a note? Add an asterisk after the -- SQLite?

03/17/08 11:24:01 changed by holdenweb

  • owner changed from nobody to holdenweb.
  • status changed from new to assigned.

04/13/08 09:33:24 changed by holdenweb

  • attachment 6047.diff added.

Fix minor nit with SQLite regexp documentation

04/13/08 09:37:35 changed by holdenweb

  • has_patch set to 1.

I would suggest that the structure of the documentation be left as it is, and the offending sentence be changed. I have attached a patch for db-api.txt (see 6047.diff).

Hopefully this will explain why the SQL looks like it does (since it is indeed the SQL that is sent to the SQLite engine in the case given).

Those seeking light relief may wish to consult http://holdenweb.blogspot.com/2008/04/for-want-of-nail.html concerning the history of the associated patch.

07/16/09 18:08:52 changed by timo

  • attachment 6047.2.diff added.

update patch to apply to trunk

07/16/09 18:09:07 changed by timo

  • needs_docs deleted.
  • stage changed from Accepted to Ready for checkin.

09/12/09 18:38:21 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [11541]) Fixed #6047 -- Minor correction to the documentation regarding regex field lookups. Thanks to Richard D. Worth for the suggestion, and Steve Holden for the text.


Add/Change #6047 (db-api docs: invalid REGEX SQL equiv for SQLite)




Change Properties
Action