XPost: linux.debian.devel
From: simon@josefsson.org
Package: wnpp
Severity: wishlist
Owner: Simon Josefsson
* Package name : golang-github-zombiezen-go-sqlite
Version : 1.4.2-1
Upstream Author : Roxy Light
* URL : https://github.com/zombiezen/go-sqlite
* License : ISC
Programming Lang: Go
Description : Low-level Go interface to SQLite 3
zombiezen.com/go/sqlite
.
Go Reference (https://pkg.go.dev/zombiezen.com/go/sqlite)
.
This package provides a low-level Go interface to SQLite 3
(https://sqlite.org/). It is a fork of crawshaw.io/sqlite
(https://github.com/crawshaw/sqlite) that uses modernc.org/sqlite
(https://pkg.go.dev/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 (https://crawshaw.io/blog/go-and-sqlite) for an
in-depth explanation. If you want to use database/sql with SQLite without
CGo, use modernc.org/sqlite directly.
.
Features
.
* Full SQLite functionality via modernc.org/sqlite,
an automatically generated translation of the original C source code of
SQLite into Go
* Builds with CGO_ENABLED=0,
allowing cross-compiling and data race detection
* Allows access to SQLite-specific features
like blob I/O (https://pkg.go.dev/zombiezen.com/go/sqlite#Blob) and
user-defined functions
(https://pkg.go.dev/zombiezen.com/go/sqlite#Conn.CreateFunction)
* Includes a simple schema migration package
(https://pkg.go.dev/zombiezen.com/go/sqlite/sqlitemigration)
* Utilities for running embedded SQL scripts
(https://pkg.go.dev/zombiezen.com/go/sqlite/sqlitex#ExecScriptFS) using
the
Go 1.16 embedding feature (https://pkg.go.dev/embed)
* A go fix-like tool (/cmd/zombiezen-sqlite-migrate/README.md) for
migrating existing code using
crawshaw.io/sqlite
* A simple REPL (https://pkg.go.dev/zombiezen.com/go/sqlite/shell) for
debugging
.
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
(https://pkg.go.dev/modernc.org/sqlite#hdr-
Supported_platforms_and_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
(https://pkg.go.dev/zombiezen.com/go/sqlite#pkg-examples) or the
reference docs (https://pkg.go.dev/zombiezen.com/go/sqlite).
.
If you're looking to switch existing code that uses crawshaw.io/sqlite,
take a look at the migration docs (/cmd/zombiezen-sqlite-
migrate/README.md).
Used by litetlog, see: https://github.com/FiloSottile/torchwood/issues/27
https://salsa.debian.org/go-team/packages/golang-github-zombiezen-go-sqlite
https://salsa.debian.org/jas/golang-github-zombiezen-go-sqlite/-/pipelines
/Simon
-----BEGIN PGP SIGNATURE-----
iQNoBAEWCAMQFiEEo8ychwudMQq61M8vUXIrCP5HRaIFAmigRL4UHHNpbW9uQGpv
c2Vmc3Nvbi5vcmfCHCYAmDMEXJLOtBYJKwYBBAHaRw8BAQdACIcrZIvhrxDBkK9f
V+QlTmXxo2naObDuGtw58YaxlOu0JVNpbW9uIEpvc2Vmc3NvbiA8c2ltb25Aam9z
ZWZzc29uLm9yZz6IlgQTFggAPgIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgBYh
BLHSvRN1vst4TPT4xNc89jjFPAa+BQJn0XQkBQkNZGbwAAoJENc89jjFPAa+BtIA
/iR73CfBurG9y8pASh3cbGOMHpDZfMAtosu6jbpO69GHAP4p7l57d+iVty2VQMsx
+3TCSAvZkpr4P/FuTzZ8JZe8BrgzBFySz4EWCSsGAQQB2kcPAQEHQOxTCIOaeXAx
I2hIX4HK9bQTpNVei708oNr1Klm8qCGKiPUEGBYIACYCGwIWIQSx0r0Tdb7LeEz0
+MTXPPY4xTw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