question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expo-sqlite - about sql regex grammar

See original GitHub issue

SQL: SELECT , count() as count FROM log_fields WHERE log REGEXP ‘(^|,)(16)(,)’ AND is_active=‘1’ AND is_delete=‘0’ GROUP BY log ORDER BY count desc LIMIT 0,10

return error message: Possible Unhandled Promise Rejection (id: 2): WebSQLTransaction { “_complete”: true, “_error”: null, “_running”: false, “_runningTimeout”: false, “_sqlQueue”: Queue { “first”: undefined, “last”: undefined, “length”: 0, }, “_websqlDatabase”: WebSQLDatabase { “_currentTask”: null, “_db”: SQLiteDatabase { “_closed”: false, “_name”: “database.db”, }, “_running”: false, “_txnQueue”: Queue { “first”: undefined, “last”: undefined, “length”: 0, }, “exec”: [Function anonymous], “version”: “1.0”, }, }

What is wrong with my sql? not support REGEXP?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RomanKwokcommented, Nov 14, 2020

This stack overflow post should answer your question- https://stackoverflow.com/questions/5071601/how-do-i-use-regex-in-a-sqlite-query

It seems like REGEXP calls a user defined function (read here - http://www.sqlite.org/c3ref/create_function.html) which must first be defined and loaded into the the database

but the main problem is that REGEXP does not exist: Error code 1: no such function: REGEXP read here: https://stackoverflow.com/questions/5071601/how-do-i-use-regex-in-a-sqlite-query he said SQLite3 supports the REGEXP operator, but expo-sqlite does not contain this feature

0reactions
adarshkhatricommented, Jul 24, 2022

I am in a similar situation. I couldn’t workout from the provided stack overflow link. Can we update the SQL version? It seems SQLite 3 has this function already.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I use regex in a SQLite query? - Stack Overflow
SELECT * FROM "table" WHERE "name" REGEXP 'sql(ite)*'; SELECT * FROM "table" WHERE regexp('sql(ite)*', "name", '#', 's');. If either $data or $ ...
Read more >
SQL Language Expressions - SQLite
The REGEXP operator is a special syntax for the regexp() user function. No regexp() user function is defined by default and so use...
Read more >
SQL RegEx | Regular Expressions in MySQL with Examples
A Regular Expression is popularly known as RegEx, is a generalized expression that is used to match patterns with various sequences of ...
Read more >
General Syntax - Using SQLite [Book] - O'Reilly
SQL consists of a number of different commands, such as CREATE TABLE or INSERT . These commands are issued and processed one at...
Read more >
SQL reference for query expressions used in ArcGIS
Mobile geodatabases, ST_geometry SQLite, GeoPackage, and Excel use SQLite SQL dialect. Databases or enterprise geodatabases use the SQL syntax of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found