question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prototoype for Datasette on PostgreSQL

See original GitHub issue

I thought this would never happen, but now that I’m deep in the weeds of running SQLite in production for Datasette Cloud I’m starting to reconsider my policy of only supporting SQLite.

Some of the factors making me think PostgreSQL support could be worth the effort:

  • Serverless. I’m getting increasingly excited about writable-database use-cases for Datasette. If it could talk to PostgreSQL then users could easily deploy it on Heroku or other serverless providers that can talk to a managed RDS-style PostgreSQL.
  • Existing databases. Plenty of organizations have PostgreSQL databases. They can export to SQLite using db-to-sqlite but that’s a pretty big barrier to getting started - being able to run datasette postgresql://connection-string and start trying it out would be a massively better experience.
  • Data size. I keep running into use-cases where I want to run Datasette against many GBs of data. SQLite can do this but PostgreSQL is much more optimized for large data, especially given the existence of tools like Citus.
  • Marketing. Convincing people to trust their data to SQLite is potentially a big barrier to adoption. Even if I’ve convinced myself it’s trustworthy I still have to convince everyone else.
  • It might not be that hard? If this required a ground-up rewrite it wouldn’t be worth the effort, but I have a hunch that it may not be too hard - most of the SQL in Datasette should work on both databases since it’s almost all portable SELECT statements. If Datasette did DML this would be a lot harder, but it doesn’t.
  • Plugins! This feels like a natural surface for a plugin - at which point people could add MySQL support and suchlike in the future.

The above reasons feel strong enough to justify a prototype.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
simonwcommented, May 26, 2021

Worth mentioning here: I’ve been doing a tun of research around running Datasette-like functionality against PostgreSQL in my https://github.com/simonw/django-sql-dashboard project - which will definitely inform the Datasette implementation.

1reaction
simonwcommented, Mar 12, 2021

Challenge: what’s the equivalent for PostgreSQL of opening a database in read only mode? Will I have to talk users through creating read only credentials?

It looks like the answer to this is yes - I’ll need users to setup read-only credentials. Here’s a TIL about that: https://til.simonwillison.net/postgresql/read-only-postgresql-user

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rapid Prototyping Tool - PostgreSQL
I'm looking for a tool that can create a rapid prototype (proof of concept) for an application, based on an existing PostgreSQL database....
Read more >
Build a Data Access Layer with PostgreSQL and Node.js
Find out how to create a Data Access Layer that communicates to PostgreSQL through Node.js.
Read more >
THE DESIGN OF POSTGRES Abstract 1. INTRODUCTION 1
The INGRES relational database management system (DBMS) was implemented during. 1975-1977 at the Univerisity of California. Since 1978 various prototype ...
Read more >
Tracking changes in PostgreSQL - CYBERTEC
First of all we need a table to store those changes. For a quick prototype we can use the following table structure.
Read more >
Using basic SQL prototyping - IBM
Using basic SQL prototyping ... To display the primary Basic SELECT Prototyping panel, select option 1 (Basic) on the SQL Prototyping, Execution and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found