mysql

package
v0.0.0-...-1a11905 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is a wrapper over *sql.DB,

func (*DB) Close

func (db *DB) Close() error

Close shutsdown the database driver.

func (*DB) CmpAndSwap

func (db *DB) CmpAndSwap(bucket, key, oldValue, newValue []byte) ([]byte, bool, error)

CmpAndSwap modifies the value at the given bucket and key (to newValue) only if the existing (current) value matches oldValue.

func (*DB) CreateTable

func (db *DB) CreateTable(bucket []byte) error

CreateTable creates a table in the database.

func (*DB) Del

func (db *DB) Del(bucket, key []byte) error

Del deletes a row from the database.

func (*DB) DeleteTable

func (db *DB) DeleteTable(bucket []byte) error

DeleteTable deletes a table in the database.

func (*DB) Get

func (db *DB) Get(bucket, key []byte) ([]byte, error)

Get retrieves the column/row with given key.

func (*DB) List

func (db *DB) List(bucket []byte) ([]*database.Entry, error)

List returns the full list of entries in a column.

func (*DB) Open

func (db *DB) Open(dataSourceName string, opt ...database.Option) error

Open creates a Driver and connects to the database with the given address and access details.

func (*DB) Set

func (db *DB) Set(bucket, key, value []byte) error

Set inserts the key and value into the given bucket(column).

func (*DB) Update

func (db *DB) Update(tx *database.Tx) error

Update performs multiple commands on one read-write transaction.

Jump to

Keyboard shortcuts

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