Watch
1
Fork
You've already forked go-sqlite-zombiezen
0
mirror of https://github.com/zombiezen/go-sqlite.git synced 2026-11-23 18:17:02 +00:00
Low-level Go interface to SQLite 3 https://pkg.go.dev/zombiezen.com/go/sqlite
  • Go 99.9%
  • Nix 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] ca2041ed3d
Bump actions/checkout from 6 to 7 (#138)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-20 09:57:50 -07:00
.github Bump actions/checkout from 6 to 7 (#138) 2026-06-20 09:57:50 -07:00
.vscode New name 2024-07-16 10:51:15 -07:00
cmd/zombiezen-sqlite-migrate New name 2024-07-16 10:51:15 -07:00
ext New name 2024-07-16 10:51:15 -07:00
shell New name 2024-07-16 10:51:15 -07:00
sqlitefile New name 2024-07-16 10:51:15 -07:00
sqlitemigration New name 2024-07-16 10:51:15 -07:00
sqlitex Add mapping of untyped nil args to BindNull to exec docs (#122) 2025-07-02 15:33:10 -07:00
.envrc Use flake for Nix dev shell 2023-12-05 15:24:12 -08:00
.gitignore First commit of zombiezen.com/go/sqlite 2021-03-29 15:52:18 -07:00
auth.go New name 2024-07-16 10:51:15 -07:00
auth_test.go New name 2024-07-16 10:51:15 -07:00
backup.go New name 2024-07-16 10:51:15 -07:00
backup_example_test.go Add backup API 2023-02-01 22:29:02 -08:00
backup_test.go New name 2024-07-16 10:51:15 -07:00
blob.go New name 2024-07-16 10:51:15 -07:00
blob_test.go New name 2024-07-16 10:51:15 -07:00
blocking_step.go New name 2024-07-16 10:51:15 -07:00
CHANGELOG.md Fix variable shadowing in resultError that silently swallows function errors (#133) 2026-03-22 09:33:14 -07:00
CODE_OF_CONDUCT.md New name 2024-07-16 10:51:15 -07:00
CONTRIBUTING.md Rework contributing guide to reflect the new nature of the project 2024-03-27 11:51:44 -07:00
doc.go New name 2024-07-16 10:51:15 -07:00
example_test.go New name 2024-07-16 10:51:15 -07:00
export_test.go New name 2024-07-16 10:51:15 -07:00
flake.lock Update Go version used in dev and CI 2025-05-23 13:40:22 -07:00
flake.nix Update Go version used in dev and CI 2025-05-23 13:40:22 -07:00
func.go Fix variable shadowing in resultError that silently swallows function errors (#133) 2026-03-22 09:33:14 -07:00
func_test.go Fix variable shadowing in resultError that silently swallows function errors (#133) 2026-03-22 09:33:14 -07:00
go.mod Update to modernc.org/sqlite@v1.37.1 2025-05-23 15:11:01 -07:00
go.sum Update to modernc.org/sqlite@v1.37.1 2025-05-23 15:11:01 -07:00
go.work Update to modernc.org/sqlite@v1.37.1 2025-05-23 15:11:01 -07:00
go.work.sum Update to modernc.org/sqlite@v1.37.1 2025-05-23 15:11:01 -07:00
http_example_test.go New name 2024-07-16 10:51:15 -07:00
index_constraint.go New name 2024-07-16 10:51:15 -07:00
internal_test.go New name 2024-07-16 10:51:15 -07:00
LICENSE New name 2024-07-16 10:51:15 -07:00
op_type.go New name 2024-07-16 10:51:15 -07:00
openflags.go Adjust OpenFlags comment wording for clarity when rendered (#114) 2025-03-10 00:34:09 +00:00
README.md Reformat README to use semantic line breaks 2021-11-29 08:40:13 -08:00
result.go Add explicit synchronization for sqlite3_initialize 2024-09-23 11:10:47 -07:00
result_test.go New name 2024-07-16 10:51:15 -07:00
session.go Add explicit synchronization for sqlite3_initialize 2024-09-23 11:10:47 -07:00
session_test.go Bring session API back 2021-08-15 13:14:11 -07:00
sqlite.go Eliminate allocation in *Stmt.ColumnName 2025-05-23 13:45:26 -07:00
sqlite_test.go New name 2024-07-16 10:51:15 -07:00
vtable.go New name 2024-07-16 10:51:15 -07:00
vtable_example_test.go New name 2024-07-16 10:51:15 -07:00

zombiezen.com/go/sqlite

Go Reference

This package provides a low-level Go interface to SQLite 3. It is a fork of crawshaw.io/sqlite that uses modernc.org/sqlite, a CGo-free SQLite package. It aims to be a mostly drop-in replacement for crawshaw.io/sqlite.

This package deliberately does not provide a database/sql driver. See David Crawshaw's rationale for an in-depth explanation. If you want to use database/sql with SQLite without CGo, use modernc.org/sqlite directly.

Features

Install

go get zombiezen.com/go/sqlite

While this library does not use CGo, make sure that you are building for one of the supported architectures.

Getting Started

import (
  "fmt"

  "zombiezen.com/go/sqlite"
  "zombiezen.com/go/sqlite/sqlitex"
)

// ...

// Open an in-memory database.
conn, err := sqlite.OpenConn(":memory:", sqlite.OpenReadWrite)
if err != nil {
  return err
}
defer conn.Close()

// Execute a query.
err = sqlitex.ExecuteTransient(conn, "SELECT 'hello, world';", &sqlitex.ExecOptions{
  ResultFunc: func(stmt *sqlite.Stmt) error {
    fmt.Println(stmt.ColumnText(0))
    return nil
  },
})
if err != nil {
  return err
}

If you're creating a new application, see the package examples or the reference docs.

If you're looking to switch existing code that uses crawshaw.io/sqlite, take a look at the migration docs.

License

ISC