Opened 8 years ago

Closed 6 years ago

#6047 closed (fixed)

db-api docs: invalid REGEX SQL equiv for SQLite

Reported by: Richard D. Worth <rdworth@…> Owned by: holdenweb
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (2)

6047.diff (742 bytes) - added by holdenweb 7 years ago.
Fix minor nit with SQLite regexp documentation
6047.2.diff (785 bytes) - added by timo 6 years ago.
update patch to apply to trunk

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by Simon G <dev@…>

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 years ago by mtredinnick

  • Description modified (diff)

comment:3 Changed 8 years ago 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?

comment:4 Changed 8 years ago by Richard D. Worth <rdworth@…>

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?

comment:5 Changed 7 years ago by holdenweb

  • Owner changed from nobody to holdenweb
  • Status changed from new to assigned

Changed 7 years ago by holdenweb

Fix minor nit with SQLite regexp documentation

comment:6 Changed 7 years ago by holdenweb

  • Has patch set

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.

Changed 6 years ago by timo

update patch to apply to trunk

comment:7 Changed 6 years ago by timo

  • Needs documentation unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:8 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

(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.

Note: See TracTickets for help on using tickets.
Back to Top