Designing a write API for Datasette

Building out Datasette Cloud has made one thing clear to me: Datasette needs a write API for ingesting new data into its attached SQLite databases. I had originally thought that โ€ฆ

@simon I've been looking forward to this.
@simon thank you for the copious amount of open development and knowledge sharing that you do. One thing I am curious about your write API is what is the significance of the dash in the URL? For example in /database/table/-/insert

@keithbloom that's a convention I use elsewhere in Datasette. If you have a database called "fixtures.db" and on called "tils.db" then the URLs to them will be /tils and /docs - e.g. https://til.simonwillison.net/tils - so I reserve "-" to mean "stuff that isn't a database, such as https://til.simonwillison.net/-/plugins

I'm using the same trick here - so /docs/mytable is the mytable table but /docs/-/create is the create-table API, avoiding clashing with a table called "create"

tils

@simon ah, that makes sense and it's a nice pattern to avoid name collisions.

It caught my eye because the only other time I have seen this is in npm package URLs and I also wonder why it's there.

@simon I โค๏ธ how the auth token library is called itsdangerous ๐Ÿ˜…
@carlton @simon IIRC Armin called it that way when he ported Django's cookie signing code for use in Flask