Skip to content

Sqlite query fails on REGEXP function call #1476

Open
@eljfe

Description

@eljfe

Describe the bug
SQLTools, SQLite extension not recognizing REGEXP sqlite function call, giving the following error message: SQLITE_ERROR: no such function: REGEXP.

**SQLTools: Show output channel logs. **

[1746214331962] INFO  (ext): SQLTools is starting
[1746214331964] INFO  (ext): initializing language client...
[1746214331965] INFO  (ext): Detecting node path (if this stalls check Terminal view for the stuck session and kill it)...
    ns: "lc"
[1746214332879] INFO  (ext): Node runtime auto-detected. Using /usr/bin/node.
    ns: "lc"
[1746214332880] INFO  (ext): Registering client for languages [{"scheme":"sqltools"},{"language":"sql","scheme":"untitled"},{"language":"sql","scheme":"file"},{"language":"sql","scheme":"sqltools"}]
    ns: "lc"
[1746214332885] INFO  (ext): loading plugins...
[1746214332885] INFO  (ext): registering Formatter Plugin.
    plugin: {
      "name": "Formatter Plugin"
    }
[1746214332885] INFO  (ext): registering Connection Manager Plugin.
    plugin: {
      "name": "Connection Manager Plugin"
    }
[1746214332886] INFO  (ext): registering CodeLens Plugin.
    plugin: {
      "name": "CodeLens Plugin",
      "registeredLanguages": []
    }
[1746214332887] INFO  (ext): registering Dependency Manager Plugin.
    plugin: {
      "name": "Dependency Manager Plugin",
      "installingDrivers": []
    }
[1746214332889] INFO  (ext): Connection explorer changed. Will be updated.
    ns: "conn-man:explorer"
[1746214332890] INFO  (ext): registering History Manager Plugin.
    plugin: {
      "name": "History Manager Plugin"
    }
[1746214332890] INFO  (ext): registering Bookmarks Manager Plugin.
    plugin: {
      "name": "Bookmarks Manager Plugin"
    }
[1746214332891] INFO  (ext): registering Authentication Provider Plugin.
    plugin: {
      "name": "Authentication Provider Plugin",
      "isRegistered": false
    }
[1746214332891] INFO  (ext): registering Object Drop-in Provider (plugin).
    plugin: {
      "type": "plugin",
      "name": "Object Drop-in Provider",
      "isRegistered": false
    }
[1746214332892] INFO  (ext): SQLTools activation completed. 930.500153 ms
[1746214332892] INFO  (ext): Formatter Plugin registered!
[1746214332892] INFO  (ext): CodeLens Plugin registered!
[1746214332893] INFO  (ext): Dependency Manager Plugin registered!
[1746214332893] INFO  (ext): Connection Manager Plugin registered!
[1746214332893] INFO  (ext): History Manager Plugin registered!
[1746214332893] INFO  (ext): Bookmarks Manager Plugin registered!
[1746214332893] INFO  (ext): Authentication Provider Plugin registered!
[1746214332893] INFO  (ext): Object Drop-in Provider (plugin) registered!
[1746214332938] INFO  (ext): registering SQLite Plugin (driver).
    plugin: {
      "extensionId": "mtxr.sqltools-driver-sqlite",
      "name": "SQLite Plugin",
      "type": "driver"
    }
[1746214332939] INFO  (ext): Connection explorer changed. Will be updated.
    ns: "conn-man:explorer"
[1746214333162] INFO  (ls): SQLTools Server started!
===============================
Using node runtime?: yes
ExecPath: /usr/bin/node v18.19.0
===============================
[1746214333174] INFO  (ext): LanguageClient ready
    ns: "lc"
[1746214333172] INFO  (ls): Initialized with node version:v18.19.0
[1746214333177] INFO  (ls): REQUEST RECEIVED => ls/RegisterPlugin
[1746214333177] INFO  (ls): request to register plugin: "/home/hh/.vscode-oss/extensions/mtxr.sqltools-driver-sqlite-0.5.2-universal/out/ls/plugin.js"
[1746214333216] INFO  (ls): Driver sqlite registered!
    place: "driver-map"
    ns: "ls-context"
[1746214333216] INFO  (ext): SQLite Plugin (driver) registered!
[1746214334217] INFO  (ext): EXECUTING COMMAND => sqltools.refreshTree
[1746214334217] INFO  (ext): Connection explorer changed. Will be updated.
    ns: "conn-man:explorer"
[1746214334891] INFO  (ext): Connection explorer changed. Will be updated.
    ns: "conn-man:explorer"
[1746214410960] INFO  (ext): EXECUTING COMMAND => sqltools.executeQuery
[1746214410960] INFO  (ext): EXECUTING COMMAND => sqltools.getConnections
[1746214410961] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214410963] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214410964] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214413512] INFO  (ext): EXECUTING COMMAND => sqltools.getConnections
[1746214413513] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214413516] INFO  (ls): REQUEST RECEIVED => connection/ConnectRequest
[1746214413521] INFO  (ls): Connection instance created for findata.
    ns: "conn-manager"
[1746214413550] INFO  (ext): Connection explorer changed. Will be updated.
    ns: "conn-man:explorer"
[1746214413550] INFO  (ext): EXECUTING COMMAND => sqltools.getConnections
[1746214413551] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214415057] INFO  (ext): EXECUTING COMMAND => sqltools.getConnections
[1746214415059] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1746214415061] INFO  (ls): REQUEST RECEIVED => connection/RunCommandRequest
[1746214415077] ERROR (ls): {"code":-32001,"data":{"driver":"SQLite","driverOptions":{}},"name":"Error"}
    ns: "conn"
[1746214422026] INFO  (ls): REQUEST RECEIVED => connection/ReleaseResultsRequest
[1746215787744] INFO  (ext): EXECUTING COMMAND => sqltools.copyText
[1746215788928] INFO  (ext): EXECUTING COMMAND => sqltools.copyText
[1746215790936] INFO  (ext): EXECUTING COMMAND => sqltools.copyTextFromTreeItem
[1746216172220] INFO  (ext): EXECUTING COMMAND => sqltools.showOutputChannel

To Reproduce

Run a query containing a REGEXP function call.

i.e. SELECT * FROM price WHERE lower(price.code) REGEXP '.*234324*';

Expected behavior

Run a query containing a REGEXP function call without error.

Screenshots

Image

Desktop (please complete the following information):

  • SQLTools Version 0.28.4

  • VS Code Version:
    VSCODIUM
    Version: 1.99.32846
    Commit: 0d1cad16ae0ec643ad1fd85b4ba8e52dacf42e85
    Date: 2025-04-28T14:55:26.901Z
    Electron: 34.3.3
    ElectronBuildId: undefined
    Chromium: 132.0.6834.210
    Node.js: 20.18.3
    V8: 13.2.152.41-electron.0
    OS: Linux x64 6.1.0-34-amd64

  • Driver:

    • PostgreSQL/Redshift
    • MySQL/MariaDB
    • MSSQL/Azure
    • [ X] SQLite
    • Other? Which...
  • Database version: [e.g. MySQL v5.6, PostgreSQL vX...]

SQLITE 3.40.1 2022-12-28

Additional context

I have the additional perl module installed,

$ apt list --installed | grep -E "^sqlite"
sqlite3-pcre/stable,now 0~git20070120091816+4229ecc-2 amd64 [installed]
sqlite3/stable,now 3.40.1-2+deb12u1 amd64 [installed]

REGEXP runs without issue in the sqlite shell.

thx

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions