sql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSQLRows

func ParseSQLRows(rows *sql.Rows, schema interface{}) ([]interface{}, error)

ParseSQLRows will parse the row

func TestStorePutGet

func TestStorePutGet(sqlStore Store, t *testing.T)

TestStorePutGet define the common test cases for put and get

func TestStoreTransaction

func TestStoreTransaction(sqlStore Store, t *testing.T)

TestStoreTransaction define the common test cases for transaction

Types

type ActionHistory

type ActionHistory struct {
	NodeAddress string
	UserAddress string
	ActionHash  string
}

ActionHistory define the schema for action history

type Store

type Store interface {
	lifecycle.StartStopper

	// Get DB instance
	GetDB() *sql.DB

	// Transact wrap the transaction
	Transact(txFunc func(*sql.Tx) error) (err error)
}

Store is the interface of KV store.

func NewAwsRDS

func NewAwsRDS(cfg config.RDS) Store

NewAwsRDS instantiates an aws rds

func NewMySQL

func NewMySQL(connectStr string, dbName string) Store

NewMySQL instantiates a mysql

Jump to

Keyboard shortcuts

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