gosqlproxy

package module
v0.0.0-...-9ad33ba Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2014 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Go SQL proxy driver

Go SQL proxy driver aimed for heavy write performance

Status: planning

Goal

  • Provide Go SQL proxy driver to handle multiple data sources, primarily for master-slave, master-master replication RMDBS (i.e., MySQL, PostgreSQL)
  • Slave DB will be choosen by default for SELECT operation
  • Async DB INSERT/UPDATE/DELETE operations for maximium write IO throughput

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func DebugLog

func DebugLog(format string, a ...interface{})

Debug prints a debug information to the log with file and line.

func ErrorLog

func ErrorLog(format string, a ...interface{})

func InfoLog

func InfoLog(format string, a ...interface{})

func Init

func Init(maxIdleOpenConns, maxOpenConns int)

func RegisterDSNTranslator

func RegisterDSNTranslator(driverName string, translator func(*url.URL) string) (err error)

Types

type DSNInfo

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

func NewDSNInfo

func NewDSNInfo() *DSNInfo

type ExecCtx

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

func (*ExecCtx) Exec

func (execCtx *ExecCtx) Exec()

type ProxyConn

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

func (*ProxyConn) Begin

func (c *ProxyConn) Begin() (tx driver.Tx, err error)

func (*ProxyConn) Close

func (c *ProxyConn) Close() (err error)

func (*ProxyConn) Prepare

func (c *ProxyConn) Prepare(query string) (driver.Stmt, error)

type ProxyDriver

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

func (*ProxyDriver) Open

func (d *ProxyDriver) Open(name string) (driver.Conn, error)

Only accept DSN common format (http://pear.php.net/manual/en/package.database.db.intro-dsn.php), multiple data sources separated by ';' mysql://[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN][#master];mysql://[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN][#slave];params:///?asyncwrite=true

type ProxyExecer

type ProxyExecer struct {
}

type ProxyRows

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

func (*ProxyRows) Close

func (r *ProxyRows) Close() (err error)

func (*ProxyRows) Columns

func (r *ProxyRows) Columns() []string

func (*ProxyRows) Next

func (r *ProxyRows) Next(dest []driver.Value) error

type ProxyStmt

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

func (*ProxyStmt) Close

func (s *ProxyStmt) Close() (err error)

func (*ProxyStmt) Exec

func (s *ProxyStmt) Exec(args []driver.Value) (result driver.Result, err error)

func (*ProxyStmt) NumInput

func (s *ProxyStmt) NumInput() int

func (*ProxyStmt) Query

func (s *ProxyStmt) Query(args []driver.Value) (driver.Rows, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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