Tutorial should note that MATCH doesn't work out-of-the-box in SQLite

Issue #3059 resolved
Delete Me created an issue

The following example in the tutorial doesn't work when using SQLite as instructed, raising an OperationalError:

# The tutorial doesn't make this explicit:
# query = session.query(User)

query.filter(User.name.match('wendy'))

The tutorial should note that MATCH (like REGEXP) doesn't work out-of-the-box in SQLite:

The MATCH operator is a special syntax for the match() application-defined function. The default match() function implementation raises an exception and is not really useful for anything. But extensions can override the match() function with more helpful logic.

Comments (4)

  1. Mike Bayer repo owner
    • hyperlink all the column operators listed in the ORM tutorial common filter operators section
    • add language to MATCH explicitly stating this operator varies by backend and is not available on SQLite, as the tutorial defaults to SQLite to start with, fix #3059
    • on the actual match() documentation fix this up to be more accurate, list some example renderings for different backends. again mention SQLite not supported

    → <<cset 931685bac916>>

  2. Mike Bayer repo owner
    • hyperlink all the column operators listed in the ORM tutorial common filter operators section
    • add language to MATCH explicitly stating this operator varies by backend and is not available on SQLite, as the tutorial defaults to SQLite to start with, fix #3059
    • on the actual match() documentation fix this up to be more accurate, list some example renderings for different backends. again mention SQLite not supported

    → <<cset 0e70d8ca7af1>>

  3. Mike Bayer repo owner
    • hyperlink all the column operators listed in the ORM tutorial common filter operators section
    • add language to MATCH explicitly stating this operator varies by backend and is not available on SQLite, as the tutorial defaults to SQLite to start with, fix #3059
    • on the actual match() documentation fix this up to be more accurate, list some example renderings for different backends. again mention SQLite not supported

    → <<cset 96b24ec545fa>>

  4. Log in to comment