connection

package
v1.0.107 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvBool

func GetEnvBool(value string) bool

func GetEnvInt

func GetEnvInt(value string) int

func GetEnvString

func GetEnvString(value string) string

Types

type ConfigOra

type ConfigOra struct {
	Drive    Drive
	Host     string
	User     string
	Pass     string
	Port     int
	Database string
	Schema   string
	Sid      string
}

func GetConfigOra

func GetConfigOra(d Drive) *ConfigOra

func (*ConfigOra) GetUrl

func (cf *ConfigOra) GetUrl() string

func (*ConfigOra) Load

func (cf *ConfigOra) Load() *ConfigOra

type Conn

type Conn struct {
	Db *sql.DB
	// contains filtered or unexported fields
}

func GetConn

func GetConn(d Drive) (*Conn, error)

func (*Conn) Commit

func (co *Conn) Commit() error

func (*Conn) Disconnect

func (co *Conn) Disconnect()

func (*Conn) Exec

func (co *Conn) Exec(sql string, arg ...any) (sql.Result, error)

func (*Conn) Rollback

func (co *Conn) Rollback() error

func (*Conn) SetConfig

func (co *Conn) SetConfig(cf *ConfigOra) *Conn

func (*Conn) StartTransaction

func (co *Conn) StartTransaction() error

type Drive

type Drive int
var (
	ORA Drive = 0
	PG  Drive = 1
)

Jump to

Keyboard shortcuts

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