status-go/vendor/zombiezen.com/go/sqlite
Andrea Maria Piana 4d15ae8a85 Upgrade to go 1.18
2022-05-11 12:39:54 +01:00
..
fs Add torrent library dependency 2022-04-06 11:48:16 +02:00
sqlitex Add torrent library dependency 2022-04-06 11:48:16 +02:00
.gitignore Add torrent library dependency 2022-04-06 11:48:16 +02:00
auth.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
blob.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
blocking_step.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
CHANGELOG.md Add torrent library dependency 2022-04-06 11:48:16 +02:00
CODE_OF_CONDUCT.md Add torrent library dependency 2022-04-06 11:48:16 +02:00
CONTRIBUTING.md Add torrent library dependency 2022-04-06 11:48:16 +02:00
doc.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
func.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
LICENSE Add torrent library dependency 2022-04-06 11:48:16 +02:00
op_type.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
openflags.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
README.md Add torrent library dependency 2022-04-06 11:48:16 +02:00
result.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
session.go Add torrent library dependency 2022-04-06 11:48:16 +02:00
sqlite.go Add torrent library dependency 2022-04-06 11:48:16 +02: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.ExecTransient(conn, "SELECT 'hello, world';", 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