sqltools-duckdb-driver icon indicating copy to clipboard operation
sqltools-duckdb-driver copied to clipboard

[VSCode Extension]: Cannot connect to DuckDB database due to broken driver detection behind corporate Proxy.

Open evx73 opened this issue 1 year ago • 5 comments
trafficstars

Describe the bug

Cannot connect to DuckDB database due to broken driver detection behind corporate Proxy.

Steps to Reproduce

Set a new DuckDB connection, and connect

SqlTools log:

ERROR (ls): Connecting error: {"code":1000,"data":{"notification":"Core/missingModule","dontNotify":true,"args":{"conn":{"name":"DuckDB2","accessMode":"Read/Write","previewLimit":50,"driver":"DuckDB","databaseFilePath":":memory:","isActive":false,"isConnected":false,"id":"DuckDB2|DuckDB||"},"action":"install","deps":[{"type":"package","name":"duckdb-async","version":"0.10.2"}]}}} ns: "conn-manager"

Warning: You need to install "[email protected]" to conttect to DuckDB

Action: Install now

Info: "[email protected]" installed. Go ahead and connect!

Action: Connect to DuckDB

Repeat from step "2" above

Logs

ERROR (ls): Connecting error: {"code":1000,"data":{"notification":"Core/missingModule","dontNotify":true,"args":{"conn":{"name":"DuckDB2","accessMode":"Read/Write","previewLimit":50,"driver":"DuckDB","databaseFilePath":":memory:","isActive":false,"isConnected":false,"id":"DuckDB2|DuckDB||"},"action":"install","deps":[{"type":"package","name":"duckdb-async","version":"0.10.2"}]}}}
ns: "conn-manager"

System Info

SQLTools Version 0.28.3
VS Code Version: 1.92.0
OS: Windows 10
Driver:
DuckDBDriver for SQLTools Version 1.0.0
Database version: :memory:
Node: node-v19.9.0-x64 or node-v20.16.0-x64

Severity

serious, but I can work around it

Additional Information, or Workarounds

Raise as vscode-sqltools bug and I was advised to raise a bug with the author of the DuckDB driver https://github.com/mtxr/vscode-sqltools/issues/1362

evx73 avatar Aug 06 '24 12:08 evx73

Moving this across to the correct repo

archiewood avatar Aug 06 '24 13:08 archiewood

I have logged the exception that causes the connection to fail.

exception duckdb-async 0.10.2 Error: Module did not self-register: '\\?\C:\Users\XXXX\AppData\Local\vscode-sqltools\Data\node_modules\duckdb\lib\binding\duckdb.node'.

Do you have any suggestions on how to fix this? I have tried with several versions on nodejs and installed the module several times with no success.

This is the code to log the exception:

checkDependencies() {
....
                } catch (e) {
                  this.log.error(`exception ${dep.name} ${dep.version} ${e}`); // @hack
                  throw new missing_module_1.default(this.deps, this.credentials, mustUpgrade);
                }

evx73 avatar Aug 07 '24 09:08 evx73

See https://github.com/mtxr/vscode-sqltools/issues/1362#issuecomment-2273371479

evx73 avatar Aug 07 '24 12:08 evx73

It would be great if this extension used @duckdb/node-api. From the README:

  • Native support for Promises; no need for separate duckdb-async wrapper.

mardukbp avatar Apr 25 '25 14:04 mardukbp

It's fairly unlikely I'll get the chance to migrate to the new API - I'm not really dedicating time to this project right now.

archiewood avatar Apr 25 '25 15:04 archiewood