v_db

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbVar

type DbVar struct {
	Host         string
	Port         int
	DatabaseName string
	Username     string
	Password     string
	Schema       *string
}

type IDb

type IDb struct {
	Master SqlMaster
	Slave  SqlSlave
}

func (*IDb) SetDB

func (slf *IDb) SetDB(obj interface{})
 ============================================
	Created by andy pangaribuan on 2020/04/01
	Copyright BoltIdea. All rights reserved.
   ============================================

func (*IDb) Transaction

func (slf *IDb) Transaction() *SqlTransaction

type Postgres

type Postgres struct {
	Master SqlMaster
	Slave  SqlSlave
}

type PostgresSlave

type PostgresSlave struct {
	Slave SqlSlave
}

type SqlMaster

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

func (*SqlMaster) Exec

func (slf *SqlMaster) Exec(sqlQuery string, sqlPars ...interface{}) (err error)

func (*SqlMaster) Transaction

func (slf *SqlMaster) Transaction() *SqlTransaction

type SqlSlave

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

func (*SqlSlave) Count

func (slf *SqlSlave) Count(sqlQuery string, sqlPars ...interface{}) (int, error)

func (*SqlSlave) Select

func (slf *SqlSlave) Select(out interface{}, sqlQuery string, sqlPars ...interface{}) (*v_ext.DbUnsafeSelectError, error)

type SqlTransaction

type SqlTransaction struct {
	SqlQueries []string
	SqlPars    [][]interface{}
	// contains filtered or unexported fields
}

func (*SqlTransaction) Commit

func (slf *SqlTransaction) Commit() *v_ext.DbTxError

func (*SqlTransaction) Exec

func (slf *SqlTransaction) Exec(sqlQuery string, sqlPars ...interface{})

type VS

type VS struct{}
var Db *VS
 ============================================
	Created by andy pangaribuan on 2020/04/01
	Copyright BoltIdea. All rights reserved.
   ============================================

func (*VS) BuildPostgresConnection

func (*VS) BuildPostgresConnection(model DbVar) (connectionStr string)
 ============================================
	Created by andy pangaribuan on 2020/04/01
	Copyright BoltIdea. All rights reserved.
   ============================================

func (*VS) BuildPostgresInstance

func (*VS) BuildPostgresInstance(masterConnection string, slaveConnection string) Postgres

func (*VS) BuildPostgresInstanceSlave

func (*VS) BuildPostgresInstanceSlave(slaveConnection string) Postgres

func (*VS) Rebind

func (*VS) Rebind(sqlQuery string) string

func (*VS) SqlIn

func (*VS) SqlIn(sqlQuery string, sqlPars ...interface{}) (string, []interface{}, error)

func (*VS) SymbolParsPostgres

func (*VS) SymbolParsPostgres(sqlQuery *string, length int) string

Jump to

Keyboard shortcuts

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