Skip to content

Working directory set to notebook directory (especially for duckdb) #865

@ABChristian

Description

@ABChristian

What

It would be great if the working directory for a notebook is set to the directory the note is contained in.
Currently duckdb is running in the vscode directory.

Why (problem/use case)

I am using duckdb for a lot of file interactions: reading csv, writing etc.
So having a colocated notebook (thank you for this extension!) is a great way to perform this and document everything.

When storing to a duckdb or ducklake without using an absolut path, the files are created in vscode directory instead of the directory of the notebook itself.
I could use absolute paths, but this means it's not shareable easily, and a simple "attach file.db as db" will create the files in a location that is hard to find.
Parametrizing the calls (either by parameters or variables) increases the overhead if it's working in duckdb.

References

duckdb provides .cd for changing the directory: https://duckdb.org/docs/stable/clients/cli/dot_commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions