Add a lightweight local database to a Go application without running a separate database server.
Register custom Go functions callable from SQL queries inside a SQLite database.
Enable WAL mode and foreign key constraints via connection string options in a Go app.
Protect a SQLite database file with a username and password using the bundled user authentication extension.
| mattn/go-sqlite3 | meetecho/janus-gateway | freebsd/freebsd-src | |
|---|---|---|---|
| Stars | 9,095 | 9,088 | 9,074 |
| Language | C | C | C |
| Setup difficulty | moderate | hard | hard |
| Complexity | 2/5 | 4/5 | 5/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a C compiler (GCC or Clang) at build time, Windows users need extra setup to get a working C toolchain.
go-sqlite3 is a library that lets Go programs store and query data using SQLite, a lightweight database that lives in a single file on disk. Go has a standard interface for talking to databases, and this library connects that interface to SQLite so you can use the same code patterns you would use with any other database, just pointed at a local file instead of a server. Because SQLite is written in C, this library wraps the C code and calls it from Go. That means you need a C compiler installed on your machine when you build any Go application that uses go-sqlite3. The README notes this clearly as a requirement. On most Linux systems and macOS the compiler is already available, on Windows it requires a bit more setup. When you open a database connection you can pass a connection string with options that control how SQLite behaves. These options cover things like whether foreign key constraints are enforced, how the database handles write-ahead logging (a setting that affects performance and crash recovery), whether the database is opened in read-only mode, timeout behavior when multiple processes try to write at the same time, and time zone handling for date values. The library also supports user authentication, which is an optional SQLite extension that lets you protect a database file with a username and password. Passwords can be stored using several hashing algorithms. There is additional support for custom Go functions that you can register and then call from SQL queries, for callback hooks that fire when rows are inserted, updated, or deleted, and for loading additional SQLite extensions. The project includes an examples directory, follows the official Go release support policy, and has documentation on cross-compiling for different platforms including Android and ARM devices.
A Go library that connects Go's standard database interface to SQLite, letting your Go programs store and query data in a lightweight single-file database without running a separate server.
Mainly C. The stack also includes Go, C, SQLite.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.