sqlu

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 8 Imported by: 0

README

sqlu - sql工具包

一个简单的sql封装

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableLog

func EnableLog(tag bool)

Types

type Json

type Json map[string]string

func (*Json) Scan

func (j *Json) Scan(value interface{}) error

func (Json) Value

func (j Json) Value() (driver.Value, error)

type ScanHandler

type ScanHandler = func(scan Scanner) error

type Scanner

type Scanner = func(dest ...interface{}) error

type Session

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

func (*Session) Exec

func (s *Session) Exec(query string, conditions ...interface{}) (int64, error)

func (*Session) Find

func (s *Session) Find(handler ScanHandler) error

func (*Session) Get

func (s *Session) Get(handler ScanHandler) error

func (*Session) Query

func (s *Session) Query(query string, conditions ...interface{}) *Session

type Transactor

type Transactor = func(s *UTx) error

type UCore

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

type UDB

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

func Open

func Open(driver, dsn string) (*UDB, error)

func (*UDB) Close

func (u *UDB) Close() error

func (*UDB) Exec

func (u *UDB) Exec(query string, conditions ...interface{}) (int64, error)

func (*UDB) Query

func (u *UDB) Query(query string, conditions ...interface{}) *Session

func (*UDB) SetConnMaxIdleTime

func (u *UDB) SetConnMaxIdleTime(d time.Duration)

func (*UDB) SetConnMaxLifetime

func (u *UDB) SetConnMaxLifetime(d time.Duration)

func (*UDB) SetMaxIdleConns

func (u *UDB) SetMaxIdleConns(n int)

func (*UDB) SetMaxOpenConns

func (u *UDB) SetMaxOpenConns(n int)

func (*UDB) Transaction

func (u *UDB) Transaction(transactor Transactor) (err error)

type UTx

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

func (*UTx) Exec

func (t *UTx) Exec(query string, conditions ...interface{}) (int64, error)

func (*UTx) Find

func (t *UTx) Find(handler ScanHandler) error

func (*UTx) Get

func (t *UTx) Get(handler ScanHandler) error

func (*UTx) Query

func (t *UTx) Query(query string, conditions ...interface{}) *UTx

Jump to

Keyboard shortcuts

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