Coder Social home page Coder Social logo

evidence-dev / sqltools-duckdb-driver Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 6.0 51.6 MB

DuckDB Driver for SQLTools

Home Page: https://marketplace.visualstudio.com/items?itemName=Evidence.sqltools-duckdb-driver

License: MIT License

JavaScript 1.02% TypeScript 98.98%
duckdb sqltools sqltools-driver

sqltools-duckdb-driver's People

Contributors

archiewood avatar npatsakula avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sqltools-duckdb-driver's Issues

Read/Write Locks Database

To Reproduce

  1. Open a Read/Write connection using SQLTools to a duckdb
  2. (Don't run any queries)
  3. Attempt to access the duckdb from another client

Expected result

Another client should be able to access the duckdb

(Assuming no read/write queries are currently running)

Actual result

A .wal file is generated for the db, suggesting there are changes to the DB that are yet to be commited

IO Error: Could not set lock on file "../../needful_things.duckdb": Resource temporarily unavailable

Extra Context

See #4

This is somewhat by design from duckdb, but we should be able to close the readwrite connection after a query has finished / when there are no queries running.

I think core SQLTools is doing something unexpected here on connection which

Workarounds

  1. Either: Running any query from duckdb SQLTools seems to clear the .wal and close the connection
  2. Or: Manually close the connection from the duckdb sidebar

Support remote development/dev container

it would be great if the extension would fully support remote development. e.g. the file browser always shows the local filesystem instead of the remote one when selecting the duckdb file.

Latest release removed support for any vscode before 1.87 (Feb 2024)

I did not see any explanation in the description for this change in #12 - was it necessary? I did not see any vscode interfaces change in that PR, and only supporting the very latest VSCode is a little bit inconvenient for everyone who hasn't upgraded yet. Can this be reverted back to "^1.42.0" (or if it needs to be bumped, at least "^1.83.0"

Unable to view schema for a table.

I am getting the following error popup when I click on a table:

Request connection/GetChildrenForTreeItemRequest failed with message: Catalog Error: Table with name <table_name> does not exist! Did you mean "<schema>.<table_name>"?

Not compatible with windows / linux

Registering does not work for me, any ideas?

[1690808344855] INFO  (ls): REQUEST RECEIVED => ls/RegisterPlugin
[1690808344856] INFO  (ls): request to register plugin: "c:\Users\geoff\.vscode\extensions\evidence.sqltools-duckdb-driver-0.0.1\out\ls\plugin.js"
[1690808345187] ERROR (ls): Error registering plugin: {"code":"ERR_DLOPEN_FAILED"}
    error: {
      "code": "ERR_DLOPEN_FAILED"
    }
[1690808345192] ERROR (ext): ERROR: Error loading plugin DuckDB Driver for SQLTools Plugin Request ls/RegisterPlugin failed with message: \\?\c:\Users\geoff\.vscode\extensions\evidence.sqltools-duckdb-driver-0.0.1\node_modules\duckdb\lib\binding\duckdb.node is not a valid Win32 application.
\\?\c:\Users\geoff\.vscode\extensions\evidence.sqltools-duckdb-driver-0.0.1\node_modules\duckdb\lib\binding\duckdb.node, {"code":-32603}
    ns: "error-handler"

Switch from read-only mode to read-write mode for in memory connections

Problem

When connection to duckdb via an in memory connection and trying to do write operations (creature/update/delete). We get the following error:

Invalid Error: Cannot execute statement of type "CREATE" on database "<database_name>" which is attached in read-only mode!

Archie has pointed me to the code that is currently causing all in memory connections to only open sqltools-duckdb in read only: sqltools-duckdb-driver

Example use case of in memory

My use case is actually for an onboarding process I am setting up for some new hires. I have taken the work the dbt folk did for their jaffle-shop-template. I then just removed the dbt part so that potential hires can write some sql transformation (using no transformation tools).

I am sure there are some CI use case which could also benefit.

For reference i am working on this for Australia's NSW Department of Education onboarding for data people (they get given a range of tools such as duckdb and evidence): nsw_doe_data_case_study

Current limiation

We talked about just enabling a read-write setting for in memory connection.

The only downside is that while the connection is open, READWRITE locks the db.

Ideally a user would be able to have an open connection to duckdb via sqltools and then still access duckdb by evidence and other reporting tools.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.