sqlite

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sqlite contains an SQL projection driver for SQLite v3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(ctx context.Context, db *sql.DB) error

CreateSchema creates the schema elements required by the SQLite driver.

func DropSchema

func DropSchema(ctx context.Context, db *sql.DB) error

DropSchema drops the schema elements required by the SQLite driver.

func IsCompatibleWith added in v0.3.0

func IsCompatibleWith(db *sql.DB) bool

IsCompatibleWith returns true if the driver implemented in this package is compatible with the given database pool.

Types

type Driver

type Driver struct{}

Driver is an implementation of sql.Driver for SQLite.

func (*Driver) DeleteResource

func (*Driver) DeleteResource(
	ctx context.Context,
	db *sql.DB,
	h string,
	r []byte,
) error

DeleteResource removes the version for a specific handler and resource.

func (*Driver) QueryVersion

func (*Driver) QueryVersion(
	ctx context.Context,
	db *sql.DB,
	h string,
	r []byte,
) ([]byte, error)

QueryVersion returns the version for a specific handler and resource.

func (*Driver) StoreVersion added in v0.3.2

func (*Driver) StoreVersion(
	ctx context.Context,
	db *sql.DB,
	h string,
	r, v []byte,
) error

StoreVersion unconditionally updates the version for a specific handler and resource.

v must be non-empty, to set an empty version, use DeleteResource().

func (*Driver) UpdateVersion

func (*Driver) UpdateVersion(
	ctx context.Context,
	tx *sql.Tx,
	h string,
	r, c, n []byte,
) (bool, error)

UpdateVersion updates the version for a specific handler and resource.

Jump to

Keyboard shortcuts

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