News for hackers. Stuff that matters.
Re:Show HN: Datasette – Create and publish an API for SQLite... by ptype on Tuesday November 14, 2017 @02:48AM (#15693434)
Nice! Congrats on shipping. Any particular reason it's tied closely together with sqlite rather sqlalchemy which could potentially enable a range of backends? I guess to ensure immutability?
Re:Show HN: Datasette – Create and publish an API for SQLite... by simonw on Tuesday November 14, 2017 @02:56AM (#15693459)
The "REST API for your database" thing isn't actually the part of this I'm most excited about - there are quite a few entries in that category already, such as https://github.com/jeffknupp/sandman2

The thing that excites me is being able to take almost any dataset, package it up into a simple, well-understood format and then deploy that in a read-only, highly scalable way, taking advantage of modern containerization systems.

Read-only SQLite is /perfect/ for this use-case. It's fast, widely supported, has a great feature-set and can be distributed as a single file.

My favourite feature of Datasette isn't the web UI, it's the publish command:

    datasette publish now ~/path-to-my/sqlite.db
Combined with my https://github.com/simonw/csvs-to-sqlite tool it means you can take a CSV file and turn it into a live-on-the-internet REST SQL API in literally minutes. Here are a bunch of datasets that I've done that to just today: https://github.com/simonw/datasette/wiki/Datasettes
Re:Show HN: Datasette – Create and publish an API for SQLite... by stdbrouw on Tuesday November 14, 2017 @03:46AM (#15693624)
I'm absolutely, unequivocally not trying to be snarky, but isn't CSV itself perfect for this use-case?
Re:Show HN: Datasette – Create and publish an API for SQLite... by simonw on Tuesday November 14, 2017 @10:04AM (#15695577)
CSV is a pretty terrible format for storing and transmitting data: it only supports string types, the escaping rules are poorly understood, and it can only model a single flat table.
Re:Show HN: Datasette – Create and publish an API for SQLite... by _wmd on Tuesday November 14, 2017 @04:46AM (#15693816)
CSV files have a single order and no support for indexes. Even if you sort your CSV on one or more interesting columns and use binary search to locate an interesting range, you can still only do this along a single dimension, any remaining queries must scan the entire file. You'd also have to write all the code for this yourself. SQLite is a much better solution
Re:Show HN: Datasette – Create and publish an API for SQLite... by lukechilds on Tuesday November 14, 2017 @03:55AM (#15693660)
Only if you want the entire dataset. Datasette allows you to query for a subset of data.