lite

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DriverName = "lite_v0.1.0"

DriverName is the unique identifier for the lite driver.

Functions

func CreateDBConnection

func CreateDBConnection() (database.Driver, database.DB)

CreateDBConnection creates a connection to the DB.

func NewDatabase

func NewDatabase(path string, readonly bool) (database.DB, error)

NewDatabase returns a DB instance. This should be the ideal situation with lowest latency on storing or fetching data. In-memory only (as result autoDeleted). multi-instances (no singleton).

Types

type DB

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

DB represents the db struct.

func (*DB) Begin

func (db *DB) Begin(writable bool) (database.Transaction, error)

Begin builds read-only or read-write Transaction.

func (*DB) Close

func (db *DB) Close() error

Close is actually a dummy method on a lite driver.

func (*DB) Update

func (db *DB) Update(fn func(database.Transaction) error) error

Update the DB within a transaction.

func (*DB) View

func (db *DB) View(fn func(database.Transaction) error) error

View performs the equivalent of a Select SQL statement.

Jump to

Keyboard shortcuts

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