Opened 12 years ago

Closed 12 years ago

#4823 closed enhancement (fixed)

Add support for REGEXP keyword in sqlite/spatialite databases

Reported by: asuchander Owned by: Even Rouault
Priority: normal Milestone: 1.10.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: sqlite
Cc:

Description

Currently, in order to use the regex operator with spatialite one needs to load the pcre extension (https://github.com/oojah/sqlite3-pcre.git) . Unfortunately, OGR doesn't provide a mechanism to do this when it loads a sqlite database. That means that SQL queries using REGEXP cannot be used.

This also breaks support for views (such as

'CREATE VIEW wms_view as SELECT "shapefile_4864"."gid", "shapefile_4864"."lease_numb", "shapefile_4864"."sale_numbe", "shapefile_4864"."shape_area", "shapefile_4864"."shape_fid", "shapefile_4864"."the_geom", "shapefile_4864"."web_geometry" FROM "shapefile_4864" WHERE "shapefile_4864"."lease_numb" REGEXP \'(?i)\' || 'Y019'  ORDER BY "shapefile_4864"."gid" ASC'

), which might depend on the regexp operator

Per EvenR:

The source code is so small (and public domain) that it might be simpler to integrate it into OGR itself.

Perhaps it can be integrated as a feature (always support REGEXP in sqlite/spatialite databases?)

Change History (2)

comment:1 by Even Rouault, 12 years ago

Component: defaultOGR_SF
Keywords: sqlite added
Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 by Even Rouault, 12 years ago

Milestone: 2.0.0
Resolution: fixed
Status: assignedclosed

r24963: "SQLite3: make REGEXP function available by using libpcre (Unix configure support only for now) (#4823)"

r24964: "Add Windows build support for pcre (#4823)"

Note: See TracTickets for help on using tickets.