gostraw

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

README

go-straw

GORM wrapper to connect to read and write databases

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Straw

type Straw struct {
	Driver        string
	ReadDatabase  *gorm.DB
	WriteDatabase *gorm.DB
}

func Init

func Init(driver string) *Straw

func (*Straw) Conn

func (s *Straw) Conn() *gorm.DB

func (*Straw) Create

func (s *Straw) Create(value interface{}) *gorm.DB

func (*Straw) Exec

func (s *Straw) Exec(sql string, values ...interface{}) *gorm.DB

func (*Straw) Save

func (s *Straw) Save(value interface{}) *gorm.DB

func (*Straw) SetRead

func (s *Straw) SetRead(host string, port string, user string, password string, database string)

func (*Straw) SetWrite

func (s *Straw) SetWrite(host string, port string, user string, password string, database string)

func (*Straw) Where

func (s *Straw) Where(query interface{}, args ...interface{}) *gorm.DB

Jump to

Keyboard shortcuts

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