sqlite

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite reads tables from an SQLite database file, read-only and without cgo: enough to list GOG Galaxy's library. It follows the file format (https://www.sqlite.org/fileformat2.html) for table b-trees, overflow pages, records and the write-ahead log. Indexes, WITHOUT ROWID tables and UTF-16 databases aren't supported.

Index

Constants

View Source
const MaxFile = 512 << 20

MaxFile caps the size of a database (and its WAL) that is read.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is an open database. Pages are read from the file as they're needed, so a large database costs little memory; the write-ahead log (small) is read whole.

func Open

func Open(path string) (*DB, error)

Open opens a database file (and reads its -wal file, when there is one). Close it when done.

func (*DB) Close

func (db *DB) Close() error

Close closes the database file.

func (*DB) HasTable

func (db *DB) HasTable(name string) bool

HasTable reports whether the database has a table.

func (*DB) Rows

func (db *DB) Rows(name string) ([]map[string]any, error)

Rows returns every row of a table as column name → value (int64, float64, string, []byte or nil).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL