Zombie Zen

Posts tagged "database"

zombiezen.com/go/sqlite reaches 1.0

Posted at by Ross Light

I’m proud to announce that my CGo-less SQLite Go package, zombiezen.com/go/sqlite, has finally reached version 1.0. This has been the culmination of almost three years of work: I started on this project in March of 2021 as a fork of David Crawshaw’s crawshaw.io/sqlite to build on top of Jan Mercl’s amazing modernc.org/sqlite. I’ve built a number of features on top of this package such as:

  • A simple schema migration framework
  • A basic REPL
  • User-defined functions, including windows and aggregates
  • Custom virtual tables
  • Utilities for running embedded SQL scripts
  • A go fix-like tool for migrating existing code using crawshaw.io/sqlite
  • Support for running restricted SQL

Over this time, the project has been used in about a dozen open source projects and has over 350 stars on GitHub. I’ve successfully used it in a number of personal projects, including a personal accounting program and my Nix caching layer.

With the 1.0 release, I’m proud to call the API stable so that Go applications can continue to build on it for their storage needs. If you’re using zombiezen.com/go/sqlite for something interesting, let me know about it, and consider supporting me on GitHub.

Posted at
Permalink

A SQLite Notebook

Posted at by Ross Light

Similar to the Jupyter kernel for Ivy I hacked up a few months ago, I’ve created a SQLite kernel for Jupyter Notebook.

Screenshot of a SQLite Visual Studio Code notebook.

Screenshot of a SQLite Visual Studio Code notebook.

Check out the demo on GitHub! (Installation is a little DIY if you’re not using Nix, but there are instructions in the README on how to build.) Read on if you’re interested in how it works.

Read more…
Posted at
Permalink

TIL: SQLite Virtual Tables

Posted at by Ross Light

I’ve been working on implementing virtual tables for my zombiezen.com/go/sqlite package. I hadn’t used virtual tables in SQLite before this, so to get a feel for the API, I played around with the feature and read up on the documentation. Since it’s not a feature I’ve seen talked about a lot, I wanted to share what virtual tables are, why you might want to use them, and what some limitations are.

Read more…
Posted at
Permalink

Introducing postgrestest

Posted at by Ross Light

Today, I released a small library called postgrestest. It spins up an ephemeral PostgreSQL database in Go. I’ve found it quite useful for writing tests that use PostgreSQL while keeping the test hermetic and reasonably fast. In my benchmarks, starting a server takes roughly 650 milliseconds and creating a database takes roughly 20 milliseconds — a 70% improvement and 90% improvement, respectively, over a postgres Docker container in the default configuration.

You can install it with:

go get zombiezen.com/go/postgrestest
Read more…
Posted at
Permalink

FIRST Experiences with MongoDB

Posted at by Ross Light

I’m currently working on a FIRST scouting data management project in my spare time. The requirements I’m working with are fairly well-defined, but the statistics collected change from year to year. I want to be able to use the same software year after year and keep historical data intact. I’m using Django for the front-end, but instead of using a traditional SQL database, I’m experimenting with using MongoDB, one of those new, fancy No-SQL databases.

Read more…