talira

go-sqlite3

A SQLite3 driver for Go using database/sql

open sourceMITfree

go-sqlite3 is the widely used SQLite driver for Go: it plugs into the standard library database/sql interface, so you open a SQLite database with a connection string and query it like any other SQL database. It bundles SQLite and can turn on extensions and options at build time with build tags, such as full-text search, JSON and user authentication. It is a cgo package, so it compiles SQLite with a C compiler.

Problems it solves

  • use a SQLite database from my Go program
  • store data in a local file database in a Go app with database/sql
  • embed SQLite in a Go service without running a database server

Features

  • database/sql driver for SQLite
  • bundled SQLite
  • extensions such as FTS and JSON chosen by build tag
  • cross-compiles with a C toolchain

Limitations

  • It's a cgo package: building it needs CGO_ENABLED=1 and a gcc compiler on the path1

Alternatives

The same job

These do what go-sqlite3 does.

  1. Go-MySQL-Driver A pure Go MySQL driver for the database/sql package

Compare go-sqlite3 with the top 3