octillery: go.knocknote.io/octillery Index | Files | Directories

package octillery

import "go.knocknote.io/octillery"

Package octillery is a Go package for sharding databases.

It can use with every OR Mapping library (xorm, gorp, gorm, dbr...) implementing database/sql interface, or raw SQL.

Index

Package Files

octillery.go

Constants

const Version = "v1.1.1"

Version is the variable for versioning Octillery

func AfterCommitCallback Uses

func AfterCommitCallback(
    successCallback func(*osql.Tx) error,
    failureCallback func(*osql.Tx, bool, []*osql.QueryLog) error)

AfterCommitCallback set function for it is callbacked after commit. Function is set as internal global variable, so must be care possible about it is called by multiple threads.

func BeforeCommitCallback Uses

func BeforeCommitCallback(callback func(*osql.Tx, []*osql.QueryLog) error)

BeforeCommitCallback set function for it is callbacked before commit. Function is set as internal global variable, so must be care possible about it is called by multiple threads.

func Exec Uses

func Exec(db *osql.DB, queryText string) ([]*sql.Rows, sql.Result, error)

Exec invoke sql.Query or sql.Exec by query type.

There is no need to worry about whether target databases are sharded or not.

func LoadConfig Uses

func LoadConfig(configPath string) error

LoadConfig load your database configuration file.

If use with debug mode, set environment variable ( `OCTILLERY_DEBUG=1` ) before call this method.

Loaded configuration instance is set to internal global variable, therefore you can use only single configuration file at each application.

Configuration format see go.knocknote.io/octillery/config

Directories

PathSynopsis
algorithm
config
connection
connection/adapter
database/sql
debug
exec
internal
migrator
path
plugin
printer
sqlparser
transposer

Package octillery imports 11 packages (graph). Updated 2019-04-29. Refresh now. Tools for package owners.