mysql

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mysql contains an SQL projection driver for MySQL and compatible databases such as MariaDB.

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 MySQL driver.

func DropSchema

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

DropSchema drops the schema elements required by the MySQL 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 MySQL and compatible databases such as MariaDB.

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 (d *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