Documentation
¶
Overview ¶
Package sqlite is a `sqlite` implementation for Go Hosts on github.com/ncruces/go-sqlite3, which bundles SQLite and needs no cgo (chapter 9, `sqlite` Host obligations; ADR 0070). None of this is the Core: a Host passes Databases to Core.SqliteCapability.
One database is one Segment Coordinator, shared by every `sqlite` Grant on it. A Segment's first write takes the one writer connection and opens its transaction; every other read goes through a read-only connection, which in WAL mode sees the last committed state. The write lock lives in this process, so the process owns the file: it holds an exclusive lock on a sidecar database, `<path>-lock`, until it closes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is one database a Host offers through `sqlite`. Its methods are safe for concurrent use: calls from every Group take turns.
func (*Database) Coordinator ¶
func (d *Database) Coordinator() *talk.SegmentLifecycle
Coordinator is the Segment Coordinator every Grant on the database shares.