Documentation ¶
Index ¶
- Constants
- Variables
- func NewSQLiteDB(dbPath string) (*sql.DB, error)
- func ReturnErrNotFound(err error) error
- func RunMigrations(dbPath string, migrations []types.Migration) error
- func SQLiteErr(err error) (*sqlite.Error, bool)
- func SlicePtrsToSlice(slice interface{}) interface{}
- func SliceToSlicePtrs(slice interface{}) interface{}
- type AddressMeddler
- type BigIntMeddler
- type DBer
- type HashMeddler
- type MerkleProofMeddler
- type Querier
- type SQLTxer
- type Tx
- type Txer
Constants ¶
const (
UniqueConstrain = 1555
)
Variables ¶
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func NewSQLiteDB ¶
NewSQLiteDB creates a new SQLite DB
func ReturnErrNotFound ¶
func RunMigrations ¶
RunMigrations will execute pending migrations if needed to keep the database updated with the latest changes in either direction, up or down.
func SlicePtrsToSlice ¶
func SlicePtrsToSlice(slice interface{}) interface{}
SlicePtrsToSlice converts any []*Foo to []Foo
func SliceToSlicePtrs ¶
func SliceToSlicePtrs(slice interface{}) interface{}
SliceToSlicePtrs converts any []Foo to []*Foo
Types ¶
type AddressMeddler ¶
type AddressMeddler struct{}
AddressMeddler encodes or decodes the field value to or from string
func (AddressMeddler) PostRead ¶
func (b AddressMeddler) PostRead(fieldPtr, scanTarget interface{}) error
PostRead is called after a Scan operation for fields that have the AddressMeddler
func (AddressMeddler) PreRead ¶
func (b AddressMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error)
PreRead is called before a Scan operation for fields that have the AddressMeddler
func (AddressMeddler) PreWrite ¶
func (b AddressMeddler) PreWrite(fieldPtr interface{}) (saveValue interface{}, err error)
PreWrite is called before an Insert or Update operation for fields that have the AddressMeddler
type BigIntMeddler ¶
type BigIntMeddler struct{}
BigIntMeddler encodes or decodes the field value to or from string
func (BigIntMeddler) PostRead ¶
func (b BigIntMeddler) PostRead(fieldPtr, scanTarget interface{}) error
PostRead is called after a Scan operation for fields that have the BigIntMeddler
func (BigIntMeddler) PreRead ¶
func (b BigIntMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error)
PreRead is called before a Scan operation for fields that have the BigIntMeddler
func (BigIntMeddler) PreWrite ¶
func (b BigIntMeddler) PreWrite(fieldPtr interface{}) (saveValue interface{}, err error)
PreWrite is called before an Insert or Update operation for fields that have the BigIntMeddler
type HashMeddler ¶
type HashMeddler struct{}
HashMeddler encodes or decodes the field value to or from string
func (HashMeddler) PostRead ¶
func (b HashMeddler) PostRead(fieldPtr, scanTarget interface{}) error
PostRead is called after a Scan operation for fields that have the HashMeddler
func (HashMeddler) PreRead ¶
func (b HashMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error)
PreRead is called before a Scan operation for fields that have the HashMeddler
func (HashMeddler) PreWrite ¶
func (b HashMeddler) PreWrite(fieldPtr interface{}) (saveValue interface{}, err error)
PreWrite is called before an Insert or Update operation for fields that have the HashMeddler
type MerkleProofMeddler ¶
type MerkleProofMeddler struct{}
MerkleProofMeddler encodes or decodes the field value to or from string
func (MerkleProofMeddler) PostRead ¶
func (b MerkleProofMeddler) PostRead(fieldPtr, scanTarget interface{}) error
PostRead is called after a Scan operation for fields that have the MerkleProofMeddler
func (MerkleProofMeddler) PreRead ¶
func (b MerkleProofMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error)
PreRead is called before a Scan operation for fields that have the MerkleProofMeddler
func (MerkleProofMeddler) PreWrite ¶
func (b MerkleProofMeddler) PreWrite(fieldPtr interface{}) (saveValue interface{}, err error)
PreWrite is called before an Insert or Update operation for fields that have the MerkleProofMeddler
type Tx ¶
type Tx struct { SQLTxer // contains filtered or unexported fields }
func (*Tx) AddCommitCallback ¶
func (s *Tx) AddCommitCallback(cb func())
func (*Tx) AddRollbackCallback ¶
func (s *Tx) AddRollbackCallback(cb func())