• Stars
    star
    724
  • Rank 62,593 (Top 2 %)
  • Language
    Go
  • License
    ISC License
  • Created over 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Low-level Go interface to SQLite 3

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

More Repositories

1

mcm

A suite of tools to provide configuration management.
Go
69
star
2

filedrop

FileDrop is a small file sharing web app for Sandstorm
JavaScript
67
star
3

tailscale-lb

Basic load-balancer for forwarding Tailscale TCP traffic
Go
59
star
4

postgrestest

A Go test harness that starts an ephemeral PostgreSQL server
Go
41
star
5

esbuild-plugin-stimulus

esbuild plugin for automatically loading Stimulus controllers from a folder
TypeScript
27
star
6

graphql-server

GraphQL server package for Go with a focus on simplicity and efficiency
Go
26
star
7

redo-rs

Port of apenwarr's redo to Rust
Rust
26
star
8

sandpass

Password manager for Sandstorm
Go
25
star
9

aptblob

CLI for creating an APT repository on S3 or GCS
Go
17
star
10

codespaces-nix

Dev Container base image with Nix
Shell
16
star
11

setup-nix-cache-action

GitHub Action that configures Nix to read/write to a cache
TypeScript
14
star
12

zb

zombiezen build tool
C
12
star
13

nixcached

Nix cache daemon
Go
11
star
14

bass

Utilities for writing servers in Go
Go
8
star
15

clock

A Go package for writing deterministic time-based tests
Go
6
star
16

graphql-go-app

Bootstrap project with Go, TypeScript, React, and GraphQL
Go
6
star
17

go-log

Another logging package for Go.
Go
5
star
18

sqlite-notebook

A Jupyter kernel for SQLite
Rust
5
star
19

dotfiles

Ross's "dot" files: cross-machine configuration
Vim Script
5
star
20

terraform-google-hugo-site

Terraform module for Hugo on Firebase Hosting
HCL
5
star
21

redo-vscode

redo Extension for Visual Studio Code
TypeScript
4
star
22

vscode-ivy

ivy support for Visual Studio Code
TypeScript
3
star
23

jupyter-ivy

A Jupyter kernel for the ivy programming language
Jupyter Notebook
3
star
24

go-commonmark

CommonMark package for Go
Go
3
star
25

go-lua

Lua wrapped as Go package
C
3
star
26

tailscale-acls.nix

Tailscale ACLs using the Nix module system
Nix
3
star
27

terraform-google-nix-cache

A Terraform module to create a Google Cloud Storage (GCS) bucket that can be used as a Nix binary cache.
HCL
3
star
28

goray

Go
2
star
29

go-oauth2

A client for making HTTP requests authorized with OAuth 2.0 tokens as specified in RFC 6749.
Go
2
star
30

stamp.nix

Library for giving a derivation a version number based on Flake sourceInfo
Nix
2
star
31

go-bytesreplacer

Package bytesreplacer provides a utility for replacing parts of byte slices.
Go
1
star
32

nettable

Package nettable provides a client for the WPILib NetworkTables protocol.
Go
1
star
33

gopdf

Mirror of https://bitbucket.org/zombiezen/gopdf
Go
1
star
34

biome

Go
1
star
35

go-discord

Go library for interacting with the Discord API (work-in-progress)
Go
1
star
36

cardcpx

Clone of bitbucket.org/zombiezen/cardcpx
Go
1
star
37

gregorian

Go
1
star
38

oauth2l-flake

Nix packaging for oauth2l
Nix
1
star
39

batchio

Go library for converting a stream of bytes into batches of approximately equal time and space.
Go
1
star