Simon Willison’s Weblog

Subscribe
Atom feed for sqlite Random

461 posts tagged “sqlite”

2023

Release sqlite-utils-move-tables 0.1 — sqlite-utils plugin adding a move-tables command

Queryable Logging with Blacklite (via) Will Sargent describes how he built Blacklite, a Java library for diagnostic logging that writes log events (as zstd compressed JSON objects) to a SQLite database and maintains 5,000 entries in a “live” database while entries beyond that range are cycled out to an archive.db file, which is cycled to archive.timestamp.db when it reaches 500,000 items.

Lots of interesting notes here on using SQLite for high performance logging.

“SQLite databases are also better log files in general. Queries are faster than parsing through flat files, with all the power of SQL. A vacuumed SQLite database is only barely larger than flat file logs. They are as easy to store and transport as flat file logs, but work much better when merging out of order or interleaved data between two logs.”

# 21st August 2023, 6:13 pm / sqlite, logging, zstd, java

Release sqlite-utils-fast-fks 0.1 — Fast foreign key addition for sqlite-utils
Release sqlite-utils 3.35 — Python CLI utility and library for manipulating SQLite databases

Dependency Management Data (via) This is a really neat CLI tool by Jamie Tanna, built using Go and SQLite but with a feature that embeds a Datasette instance (literally shelling out to start the process running from within the Go application) to provide an interface for browsing the resulting database.

It addresses the challenge of keeping track of the dependencies used across an organization, by gathering them into a SQLite database from a variety of different sources—currently Dependabot, Renovate and some custom AWS tooling.

The “Example” page links to a live Datasette instance and includes video demos of the tool in action.

# 11th August 2023, 3:54 pm / datasette, packaging, sqlite, cli

Release sqlite-utils-jq 0.1 — Plugin adding a jq() SQL function to sqlite-utils
Release sqlite-utils-litecli 0.1.1 — Interactive shell for sqlite-utils using litecli
Release sqlite-utils-litecli 0.1 — Interactive shell for sqlite-utils using litecli

sqlite-utils now supports plugins

Visit sqlite-utils now supports plugins

sqlite-utils 3.34 is out with a major new feature: support for plugins.

[... 1,327 words]

Release sqlite-utils-shell 0.2 — Interactive shell for sqlite-utils
Release sqlite-utils-shell 0.1 — Interactive shell for sqlite-utils
Release sqlite-utils-dateutil 0.1 — Date utility functions for sqlite-utils
Release sqlite-migrate 0.1a1 — A simple database migration system for SQLite, based on sqlite-utils
Release sqlite-migrate 0.1a0 — A simple database migration system for SQLite, based on sqlite-utils
Release sqlite-utils 3.34 — Python CLI utility and library for manipulating SQLite databases

sqlite-vss v0.1.1 Annotated Release Notes (via) Alex Garcia’s sqlite-vss adds vector search directly to SQLite through a custom extension. It’s now easily installed for Python, Node.js, Deno, Elixir, Go, Rust and Ruby (“gem install sqlite-vss”), and is being used actively by enough people that Alex is getting actionable feedback, including fixes for memory leaks spotted in production.

# 20th July 2023, 5:48 pm / annotated-release-notes, sqlite, alex-garcia, vector-search

Data analysis with SQLite and Python. I turned my 2hr45m workshop from PyCon into the latest official tutorial on the Datasette website. It includes an extensive handout which should be useful independently of the video itself.

# 2nd July 2023, 4:48 pm / speaking, sqlite, datasette, python, my-talks

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

sqlean.py: Python’s sqlite3 with extensions. Anton Zhiyanov built a new Python package which bundles a fresh, compiled copy of SQLite with his SQLean family of C extensions built right in. Installing it gets you the latest SQLite—3.42.0—with nearly 200 additional functions, including things like define() and eval(), fileio_read() and fileio_write(), percentile_95() and uuid4() and many more. “import sqlean as sqlite3” works as a drop-in replacement for the module from the standard library.

# 17th June 2023, 10:42 pm / sqlite, anton-zhiyanov, python

Vector Search. Amjith Ramanujam provides a very thorough tutorial on implementing vector similarity search using SentenceTransformers embeddings (all-MiniLM-L6-v2) executed using sqlite-utils, then served via datasette-sqlite-vss and deployed using Fly.

# 2nd June 2023, 5:02 am / fly, sqlite, datasette, ai, embeddings, vector-search

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

SQLite 3.42.0. The latest SQLite has a tiny feature I requested on the SQLite Forum - SELECT unixepoch('subsec') now returns the current time in milliseconds since the Unix epoch, a big improvement on the previous recipe of select cast((julianday('now') - 2440587.5) * 86400 * 1000 as integer)!

Also in the release: JSON5 support (JSON with multi-line strings and comments), a bunch of improvements to the query planner and CLI tool, plus various interesting internal changes.

# 18th May 2023, 9:14 pm / sqlite, json

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

Big Opportunities in Small Data

Visit Big Opportunities in Small Data

I gave an invited keynote at Citus Con 2023, the PostgreSQL conference. Below is the abstract, video, slides and links from the presentation.

[... 385 words]

Enriching data with GPT3.5 and SQLite SQL functions

Visit Enriching data with GPT3.5 and SQLite SQL functions

I shipped openai-to-sqlite 0.3 yesterday with a fun new feature: you can now use the command-line tool to enrich data in a SQLite database by running values through an OpenAI model and saving the results, all in a single SQL query.

[... 1,219 words]

Data analysis with SQLite and Python for PyCon 2023

Visit Data analysis with SQLite and Python for PyCon 2023

I’m at PyCon 2023 in Salt Lake City this week.

[... 347 words]

sqlite-history: tracking changes to SQLite tables using triggers (also weeknotes)

Visit sqlite-history: tracking changes to SQLite tables using triggers (also weeknotes)

In between blogging about ChatGPT rhetoric, micro-benchmarking with ChatGPT Code Interpreter and Why prompt injection is an even bigger problem now I managed to ship the beginnings of a new project: sqlite-history.

[... 1,680 words]

Replacing my best friends with an LLM trained on 500,000 group chat messages (via) Izzy Miller used a 7 year long group text conversation with five friends from college to fine-tune LLaMA, such that it could simulate ongoing conversations. They started by extracting the messages from the iMessage SQLite database on their Mac, then generated a new training set from those messages and ran it using code from the Stanford Alpaca repository. This is genuinely one of the clearest explanations of the process of fine-tuning a model like this I’ve seen anywhere.

# 12th April 2023, 11:01 pm / llama, llms, sqlite, local-llms, fine-tuning, training-data

Running Python micro-benchmarks using the ChatGPT Code Interpreter alpha

Visit Running Python micro-benchmarks using the ChatGPT Code Interpreter alpha

Today I wanted to understand the performance difference between two Python implementations of a mechanism to detect changes to a SQLite database schema. I rendered the difference between the two as this chart:

[... 2,939 words]