You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Datasette is an amazing frontend UI that only officially supports sqlite. With datasette-parquet, a DuckDB backend works pretty well. But DuckDB is also capable of attaching a live MySQL connection with:
INSTALL mysql;
LOAD mysql;
ATTACH 'host=... user=... passwd=... port=... database=...' AS mysql_db (TYPE MYSQL);
USE mysql_db;
This opens the door to Datasette over live MySQL, which would be very attractive for many people with an existing MySQL database.
Proposal
Add a mysql config option (similar to file and directory) that takes all the config needed to create a MySQL connection string in DuckDB (e.g. db_host, ...), so that datasette works with a live MySQL connection.
The text was updated successfully, but these errors were encountered:
I got this working as a proof of concept with many hacks, which I could clean up into a PR.
Getting a MySQL connection is not hard, but then it's available at <alias>.<mysql_db_name> instead of being the default db, which means you need to add USE statements in front of every cursor creation/execution to make it run cleanly.
In my current proof-of-concept, Datasette fails on / path, works on /<db> path and all queries, but fails on /<db>/<table> path for browsing.
Incidentally, it's amazing to me to have gotten this far in just an hour or two, and I'm super impressed that you put this plugin together. Nice work 🙌
Motivation
Datasette is an amazing frontend UI that only officially supports
sqlite
. Withdatasette-parquet
, a DuckDB backend works pretty well. But DuckDB is also capable of attaching a live MySQL connection with:This opens the door to Datasette over live MySQL, which would be very attractive for many people with an existing MySQL database.
Proposal
Add a
mysql
config option (similar tofile
anddirectory
) that takes all the config needed to create a MySQL connection string in DuckDB (e.g.db_host
, ...), so that datasette works with a live MySQL connection.The text was updated successfully, but these errors were encountered: