sql

package
v0.5.0-rc10-hotfix1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 15 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 NewSQLite3

func NewSQLite3(cfg config.SQLITE3) Store

NewSQLite3 instantiates an sqlite3

Jump to

Keyboard shortcuts

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