Tcl'2018: Sqlbird - Keeping PosgreSQL database tables replicated in SQLite (Karl Lehenbauer)

Опубликовано: 22 Июль 2026
на канале: Tcl/Tk Video
235
3

Sqlbird obtains table definitions from PostgreSQL, defines corresponding tables in SQLite, and with reasonable efficiency replicates the tables from PostgreSQL to SQLite, keeping them updated according to a defined schedule, making SQLite databases available to concurrent readers who can then perform full SQL queries on them (including JOIN, etc), accessing data mirrored from the PostgreSQL database. Clients can often do work without needing to communicate with PostgreSQL at all.
Most SQL queries that work in Postgres will run unmodified in SQLite, as long as the referenced tables are present. Sqlbird's apex user function, sqlbird::select, will try the SQL query first in SQLite and fall back to PostgreSQL if it doesn't work. This gives developers functionality akin to superbird, but letting them stay with SQL rather than having to specify queries in the speedtables query language.
Sqlbird consists of a package and a few programs. Most of the work is done through calls to functions defined in the sqlbird package. This talk covers how sqlbird works, how it is configured and operated, various design decisions that were made, and details experiences from using it in commercial production.