This repository is a Go library that implements a database/sql driver for SQLite3, using cgo to bind to the SQLite C library (either the bundled amalgamation or a system-installed libsqlite3). It provides a full-featured driver supporting transactions, prepared statements, custom functions, aggregators, collations, hooks, virtual tables, backup, serialization, and many SQLite extensions via build tags. The architecture is a single-package driver with a large cgo file (sqlite3.go) and numerous optional feature files selected by build constraints. Key entry points are the SQLiteDriver, SQLiteConn, SQLiteStmt, and SQLiteRows types, which implement the standard database/sql interfaces. The codebase is mature, widely used, and actively maintained, with extensive tests and CI across platforms. It is not a standalone application but a reusable library consumed by Go programs.
Trainbot (Onlytrains) is a computer vision application that automatically detects trains passing a fixed camera, stitches the train's frames into a single composite image, and logs sightings to a SQLite database. It is designed to run on a Raspberry Pi with a camera (USB, Pi Cam 3, or video file) and can optionally upload results via FTP to a web server. The project is unmaintained as stated in the README. Architecturally, it is a monolith Go backend with three CLI binaries: `trainbot` (main detection loop), `confighelper` (interactive crop selection), and `cleanup` (orphaned blob removal). The backend captures frames using `pkg/vid` (abstraction over V4L2, libcamera-vid, ffmpeg), processes them through a stitch pipeline that detects motion, computes frame offsets via patch matching, fits a constant-acceleration model using RANSAC, and then blends frames into a single JPEG and an animated GIF. Results are stored in a SQLite database and served by a built-in HTTP server. The frontend is a Vue 3 static SPA that loads the SQLite database client-side to display train sightings, stats, and images with no server-side rendering. Key highlights include highly optimized image processing: the `pkg/pmatch` package offers four implementations of cosine-similarity patch search (slow Go, optimized Go, Cgo, Vulkan compute), and the `pkg/ransac` package provides a generic RANSAC fitter for the speed model. The codebase demonstrates strong engineering craftsmanship with a clear package structure, extensive tests, test data sets, and a CI pipeline. However, heavy reliance on Cgo and Vulkan, plus the explicit unmaintained status, introduce cross-compilation complexity and potential drift from modern tooling.