Skip to content
项目

ncruces/go-sqlite3 has 1,141 GitHub stars and 44 forks. GitHot measured +3 stars in 24 hours, +8 in 7 days, and +9 in 15 days. Last checked 2026-11-21 13:07 UTC. Last push 2026-11-18.

这些数字如何统计

可以做什么

  • incremental BLOB I/O (example)
  • nested transactions (example)
  • custom functions (example)
  • virtual tables (example)

实测星标增长

24小时
+3
7天
+8
15天
+9
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

Go bindings to SQLite using wasm2go

数据

README.md

原文

Go bindings to SQLite using wasm2go

Go Reference Go Coverage

Go module github.com/ncruces/go-sqlite3 is a cgo-free SQLite wrapper.
It provides a database/sql compatible driver, as well as direct access to most of the C SQLite API.

It wraps a Wasm build of SQLite, and uses wasm2go to translate it to Go.
Go and x/sys are the only required dependencies.

Getting started

Using the database/sql driver:


import "database/sql"
import _ "github.com/ncruces/go-sqlite3/driver"

var version string
db, _ := sql.Open("sqlite3", "file:demo.db")
db.QueryRow(`SELECT sqlite_version()`).Scan(&version)

Packages

Advanced features

Caveats

This module replaces the SQLite OS Interface (aka VFS) with a pure Go implementation, which has advantages and disadvantages. Read more about the Go VFS design here.

Because each database connection executes within a Wasm sandboxed environment, memory usage will be higher than alternatives.

Testing

This project aims for high test coverage. It also benefits greatly from SQLite's thorough testing.

Every commit is tested on:

  • Linux: amd64, arm64, 386, arm, riscv64, ppc64le, loong64, s390x
  • macOS: amd64, arm64
  • Windows: amd64, arm64
  • BSD:
    • FreeBSD: amd64, arm64
    • NetBSD: amd64, arm64
    • DragonFly BSD: amd64
    • OpenBSD: amd64
  • illumos: amd64
  • Solaris: amd64

Certain operating system and CPU combinations have some limitations. See the support matrix for a complete overview.

The Go VFS is tested by running SQLite's mptest.

Performance

Performance of the database/sql driver is competitive with alternatives.

The Wasm and VFS layers are also benchmarked by running SQLite's speedtest1.

Concurrency

This module behaves similarly to SQLite in multi-thread mode: it is goroutine-safe, provided that no single database connection, or object derived from it, is used concurrently by multiple goroutines.

The database/sql API is safe to use concurrently, according to its documentation.

FAQ, issues, new features

For questions, please see Discussions.

Also, post there if you used this driver for something interesting ("Show and tell"), have an idea…

The Issues tracker is for bugs, and features we're working on, planning to work on, or asking for help with.

探索相关项目

加载中…