Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research plugin hook for alternative database backends #1193

Open
simonw opened this issue Jan 15, 2021 · 1 comment
Open

Research plugin hook for alternative database backends #1193

simonw opened this issue Jan 15, 2021 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Jan 15, 2021

I started exploring what Datasette would like running against PostgreSQL in #670 and @dazzag24 did some work on Parquet described in #657.

I had initially thought this was WAY too much additional complexity, but I'm beginning to think that the Database class may be small enough that having it abstract away the details of running queries against alternative database backends could be feasible.

A bigger issue is SQL generation, but I realized that most of Datasette's SQL generation code exists just in the TableView class that runs the table page. If this was abstracted into some kind of SQL builder that could be then customized per-database it might be reasonable to get it working.

Very unlikely for this to make it into Datasette 1.0, but maybe this would be the defining feature of Datasette 2.0?

@simonw
Copy link
Owner Author

simonw commented Mar 12, 2021

DuckDB has a read-only mechanism: https://duckdb.org/docs/api/python

import duckdb
con = duckdb.connect(database="/tmp/blah.db", read_only=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant