Simon Willison’s Weblog

Subscribe
Atom feed for sqlite Random

447 posts tagged “sqlite”

2020

Fun with binary data and SQLite

This week I’ve been mainly experimenting with binary data storage in SQLite. sqlite-utils can now insert data from binary files, and datasette-media can serve content over HTTP that originated as binary BLOBs in a database file.

[... 957 words]

Release sqlite-utils 2.13 — Python CLI utility and library for manipulating SQLite databases

sqlite-utils 2.12 (via) I’ve been experimenting with ways of improving BLOB support in Datasette and sqlite-utils. This new version of sqlite-utils includes a “sqlite-utils insert-files” command, which can recursively crawl directories for files and add their contents to SQLite with configurable columns containing their metadata.

I was inspired by Paul Ford who has been creating multi-GB SQLite databases of images and PDFs. It turns out that when disk space is cheap this is a pretty effective way of working with interesting corpuses of documents and images.

# 27th July 2020, 7:36 am / projects, sqlite, sqlite-utils

Release sqlite-utils 2.12 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.11 — Python CLI utility and library for manipulating SQLite databases

Weeknotes: cookiecutter templates, better plugin documentation, sqlite-generate

I spent this week spreading myself between a bunch of smaller projects, and finally getting familiar with cookiecutter. I wrote about my datasette-plugin cookiecutter template earlier in the week; here’s what else I’ve been working on.

[... 703 words]

Release sqlite-utils 2.10.1 — Python CLI utility and library for manipulating SQLite databases

sqlite-generate (via) I wrote this tool today to generate arbitrarily large SQLite databases, for testing purposes. You tell it how many tables, columns and rows you want and it will use the Faker Python library to generate random data and populate the tables with it.

# 23rd June 2020, 2:19 am / projects, sqlite

Release sqlite-utils 2.10 — Python CLI utility and library for manipulating SQLite databases

Using SQL to Look Through All of Your iMessage Text Messages (via) Dan Kelch shows how to access the iMessage SQLite database at ~/Library/Messages/chat.db—it’s protected under macOS Catalina so you have to enable Full Disk Access in the privacy settings first. I usually use the macOS terminal app but I installed iTerm for this because I’d rather enable full disk access to a separate terminal program than let anything I’m running in my regular terminal take advantage of it. It worked! Now I can run “datasette ~/Library/Messages/chat.db” to browse my messages.

# 22nd May 2020, 4:45 pm / datasette, apple, sql, sqlite

Using SQL to find my best photo of a pelican according to Apple Photos

Visit Using SQL to find my best photo of a pelican according to Apple Photos

According to the Apple Photos internal SQLite database, this is the most aesthetically pleasing photograph I have ever taken of a pelican:

[... 1,937 words]

Release sqlite-utils 2.9.1 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.9 — Python CLI utility and library for manipulating SQLite databases

Weeknotes: Datasette 0.41, photos breakthroughs

Visit Weeknotes: Datasette 0.41, photos breakthroughs

Shorter weeknotes this week, because my main project for the week warrants a detailed write-up on its own (coming soon... update 21st May here it is).

[... 867 words]

Release sqlite-utils 2.8 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.7.2 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.7.1 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.7 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.6 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.5 — Python CLI utility and library for manipulating SQLite databases

Weeknotes: Datasette 0.39 and many other projects

This week’s theme: Well, I’m not going anywhere. So a ton of progress to report on various projects.

[... 806 words]

Release sqlite-utils 2.4.4 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.4.3 — Python CLI utility and library for manipulating SQLite databases

hacker-news-to-sqlite (via) The latest in my Dogsheep series of tools: hacker-news-to-sqlite uses the Hacker News API to fetch your comments and submissions from Hacker News and save them to a SQLite database.

# 21st March 2020, 4:27 am / dogsheep, projects, hacker-news, sqlite

Release sqlite-utils 2.4.2 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.4.1 — Python CLI utility and library for manipulating SQLite databases
Release sqlite-utils 2.4 — Python CLI utility and library for manipulating SQLite databases

Weeknotes: Datasette Writes

As discussed previously, the biggest hole in Datasette’s feature set at the moment involves writing to the database.

[... 604 words]

Things I learned about shapefiles building shapefile-to-sqlite

Visit Things I learned about shapefiles building shapefile-to-sqlite

The latest in my series of x-to-sqlite tools is shapefile-to-sqlite. I learned a whole bunch of things about the ESRI shapefile format while building it.

[... 1,073 words]

Release sqlite-utils 2.3.1 — Python CLI utility and library for manipulating SQLite databases