options

package
v2.0.0-...-d0150a3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InsertIgnore insertMode = iota + 1
	InsertOnDuplicate
)

insert modes :

View Source
const (
	LevelDefault         = sql.LevelDefault
	LevelReadUncommitted = sql.LevelReadUncommitted
	LevelReadCommitted   = sql.LevelReadCommitted
	LevelWriteCommitted  = sql.LevelWriteCommitted
	LevelRepeatableRead  = sql.LevelRepeatableRead
	LevelSnapshot        = sql.LevelSnapshot
	LevelSerializable    = sql.LevelSerializable
	LevelLinearizable    = sql.LevelLinearizable
)

Various isolation levels that drivers may support in BeginTx. If a driver does not support a given isolation level an error may be returned.

See https://en.wikipedia.org/wiki/Isolation_(database_systems)#Isolation_levels.

Variables

This section is empty.

Functions

func LockForShare

func LockForShare(opts ...func(l *primitive.Lock)) (l primitive.Lock)

LockForShare :

func LockForUpdate

func LockForUpdate(opts ...func(l *primitive.Lock)) (l primitive.Lock)

LockForUpdate :

Types

type ConnectOptions

type ConnectOptions struct {
	Username string
	Password string
	Protocol string
	Host     string
	Port     string
	Socket   string
	Charset  charset.Code
	Collate  string
	// contains filtered or unexported fields
}

ConnectOptions :

func Connect

func Connect() *ConnectOptions

Connect :

func (*ConnectOptions) ApplyURI

func (opt *ConnectOptions) ApplyURI(uri string) *ConnectOptions

ApplyURI :

func (*ConnectOptions) RawConnStr

func (opt *ConnectOptions) RawConnStr() string

RawConnStr :

func (*ConnectOptions) SetCharset

func (opt *ConnectOptions) SetCharset(code charset.Code) *ConnectOptions

SetCharset :

func (*ConnectOptions) SetCollate

func (opt *ConnectOptions) SetCollate(collate string) *ConnectOptions

SetCollate :

func (*ConnectOptions) SetHost

func (opt *ConnectOptions) SetHost(host string) *ConnectOptions

SetHost :

func (*ConnectOptions) SetPassword

func (opt *ConnectOptions) SetPassword(password string) *ConnectOptions

SetPassword :

func (*ConnectOptions) SetPort

func (opt *ConnectOptions) SetPort(port string) *ConnectOptions

SetPort :

func (*ConnectOptions) SetProtocol

func (opt *ConnectOptions) SetProtocol(network string) *ConnectOptions

SetProtocol :

func (*ConnectOptions) SetSocket

func (opt *ConnectOptions) SetSocket(sckt string) *ConnectOptions

SetSocket :

func (*ConnectOptions) SetUsername

func (opt *ConnectOptions) SetUsername(username string) *ConnectOptions

SetUsername :

type DeleteOneOptions

type DeleteOneOptions struct {
	DeleteOptions
}

DeleteOneOptions :

func DeleteOne

func DeleteOne() *DeleteOneOptions

DeleteOne :

func (*DeleteOneOptions) SetDebug

func (opt *DeleteOneOptions) SetDebug(debug bool) *DeleteOneOptions

SetDebug :

type DeleteOptions

type DeleteOptions struct {
	Debug bool
}

DeleteOptions :

func Delete

func Delete() *DeleteOptions

Delete :

func (*DeleteOptions) SetDebug

func (opt *DeleteOptions) SetDebug(debug bool) *DeleteOptions

SetDebug :

type DestroyOneOptions

type DestroyOneOptions struct {
	DeleteOptions
}

DestroyOneOptions :

func DestroyOne

func DestroyOne() *DestroyOneOptions

DestroyOne :

func (*DestroyOneOptions) SetDebug

func (opt *DestroyOneOptions) SetDebug(debug bool) *DestroyOneOptions

SetDebug :

type FindOneOptions

type FindOneOptions struct {
	FindOptions
}

FindOneOptions :

func FindOne

func FindOne() *FindOneOptions

FindOne :

func (*FindOneOptions) SetDebug

func (opt *FindOneOptions) SetDebug(debug bool) *FindOneOptions

SetDebug :

func (*FindOneOptions) SetLockMode

func (opt *FindOneOptions) SetLockMode(lock primitive.Lock) *FindOneOptions

SetLockMode :

func (*FindOneOptions) SetOmitFields

func (opt *FindOneOptions) SetOmitFields(fields ...string) *FindOneOptions

SetOmitFields :

type FindOptions

type FindOptions struct {
	OmitFields []string
	NoLimit    bool
	Lock       primitive.Lock
	Debug      bool
}

FindOptions :

func Find

func Find() *FindOptions

Find :

func (*FindOptions) SetDebug

func (opt *FindOptions) SetDebug(debug bool) *FindOptions

SetDebug :

func (*FindOptions) SetLockMode

func (opt *FindOptions) SetLockMode(lock primitive.Lock) *FindOptions

SetLockMode :

func (*FindOptions) SetNoLimit

func (opt *FindOptions) SetNoLimit(limit bool) *FindOptions

SetNoLimit :

func (*FindOptions) SetOmitFields

func (opt *FindOptions) SetOmitFields(fields ...string) *FindOptions

SetOmitFields :

type InsertOneOptions

type InsertOneOptions struct {
	InsertOptions
}

InsertOneOptions :

func InsertOne

func InsertOne() *InsertOneOptions

InsertOne :

func (*InsertOneOptions) SetDebug

func (opt *InsertOneOptions) SetDebug(debug bool) *InsertOneOptions

SetDebug :

func (*InsertOneOptions) SetMode

func (opt *InsertOneOptions) SetMode(mode insertMode) *InsertOneOptions

SetMode :

func (*InsertOneOptions) SetOmitFields

func (opt *InsertOneOptions) SetOmitFields(fields ...string) *InsertOneOptions

SetOmitFields :

type InsertOptions

type InsertOptions struct {
	Mode  insertMode
	Omits util.StringSlice
	Debug bool
}

InsertOptions :

func Insert

func Insert() *InsertOptions

Insert :

func (*InsertOptions) SetDebug

func (opt *InsertOptions) SetDebug(debug bool) *InsertOptions

SetDebug :

func (*InsertOptions) SetMode

func (opt *InsertOptions) SetMode(mode insertMode) *InsertOptions

SetMode :

func (*InsertOptions) SetOmitFields

func (opt *InsertOptions) SetOmitFields(fields ...string) *InsertOptions

SetOmitFields :

type IsolationLevel

type IsolationLevel = sql.IsolationLevel

IsolationLevel :

type ModifyOneOptions

type ModifyOneOptions struct {
	Omits []string
	Debug bool
}

ModifyOneOptions :

func ModifyOne

func ModifyOne() *ModifyOneOptions

ModifyOne :

func (*ModifyOneOptions) SetDebug

func (opt *ModifyOneOptions) SetDebug(debug bool) *ModifyOneOptions

SetDebug :

func (*ModifyOneOptions) SetOmitFields

func (opt *ModifyOneOptions) SetOmitFields(fields ...string) *ModifyOneOptions

SetOmitFields :

type PaginateOptions

type PaginateOptions struct {
	FindOptions
}

PaginateOptions :

func Paginate

func Paginate() *PaginateOptions

Paginate :

func (*PaginateOptions) SetDebug

func (opt *PaginateOptions) SetDebug(debug bool) *PaginateOptions

SetDebug :

type TransactionOptions

type TransactionOptions struct {
	Duration       time.Duration
	IsolationLevel IsolationLevel
	ReadOnly       bool
}

TransactionOptions :

func Transaction

func Transaction() *TransactionOptions

Transaction :

func (*TransactionOptions) SetIsolationLevel

func (opts *TransactionOptions) SetIsolationLevel(level IsolationLevel) *TransactionOptions

SetIsolationLevel :

func (*TransactionOptions) SetReadOnly

func (opts *TransactionOptions) SetReadOnly(readOnly bool) *TransactionOptions

SetReadOnly :

func (*TransactionOptions) SetTimeOut

func (opts *TransactionOptions) SetTimeOut(duration time.Duration) *TransactionOptions

SetTimeOut :

type UpdateOneOptions

type UpdateOneOptions struct {
	UpdateOptions
}

UpdateOneOptions :

func UpdateOne

func UpdateOne() *UpdateOneOptions

UpdateOne :

func (*UpdateOneOptions) SetDebug

func (opt *UpdateOneOptions) SetDebug(debug bool) *UpdateOneOptions

SetDebug :

type UpdateOptions

type UpdateOptions struct {
	Debug bool
}

UpdateOptions :

func Update

func Update() *UpdateOptions

Update :

func (*UpdateOptions) SetDebug

func (opt *UpdateOptions) SetDebug(debug bool) *UpdateOptions

SetDebug :

Jump to

Keyboard shortcuts

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