Documentation ¶
Index ¶
- Constants
- func LockForShare(opts ...func(l *primitive.Lock)) (l primitive.Lock)
- func LockForUpdate(opts ...func(l *primitive.Lock)) (l primitive.Lock)
- type ConnectOptions
- func (opt *ConnectOptions) ApplyURI(uri string) *ConnectOptions
- func (opt *ConnectOptions) RawConnStr() string
- func (opt *ConnectOptions) SetCharset(code charset.Code) *ConnectOptions
- func (opt *ConnectOptions) SetCollate(collate string) *ConnectOptions
- func (opt *ConnectOptions) SetHost(host string) *ConnectOptions
- func (opt *ConnectOptions) SetPassword(password string) *ConnectOptions
- func (opt *ConnectOptions) SetPort(port string) *ConnectOptions
- func (opt *ConnectOptions) SetProtocol(network string) *ConnectOptions
- func (opt *ConnectOptions) SetSocket(sckt string) *ConnectOptions
- func (opt *ConnectOptions) SetUsername(username string) *ConnectOptions
- type DeleteOneOptions
- type DeleteOptions
- type DestroyOneOptions
- type FindOneOptions
- type FindOptions
- type InsertOneOptions
- type InsertOptions
- type IsolationLevel
- type ModifyOneOptions
- type PaginateOptions
- type TransactionOptions
- type UpdateOneOptions
- type UpdateOptions
Constants ¶
const ( InsertIgnore insertMode = iota + 1 InsertOnDuplicate )
insert modes :
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 ¶
LockForShare :
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 (*ConnectOptions) ApplyURI ¶
func (opt *ConnectOptions) ApplyURI(uri string) *ConnectOptions
ApplyURI :
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 (*DeleteOneOptions) SetDebug ¶
func (opt *DeleteOneOptions) SetDebug(debug bool) *DeleteOneOptions
SetDebug :
type DeleteOptions ¶
type DeleteOptions struct {
Debug bool
}
DeleteOptions :
func (*DeleteOptions) SetDebug ¶
func (opt *DeleteOptions) SetDebug(debug bool) *DeleteOptions
SetDebug :
type DestroyOneOptions ¶
type DestroyOneOptions struct {
DeleteOptions
}
DestroyOneOptions :
func (*DestroyOneOptions) SetDebug ¶
func (opt *DestroyOneOptions) SetDebug(debug bool) *DestroyOneOptions
SetDebug :
type FindOneOptions ¶
type FindOneOptions struct {
FindOptions
}
FindOneOptions :
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 ¶
FindOptions :
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 (*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 (*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 ModifyOneOptions ¶
ModifyOneOptions :
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 (*PaginateOptions) SetDebug ¶
func (opt *PaginateOptions) SetDebug(debug bool) *PaginateOptions
SetDebug :
type TransactionOptions ¶
type TransactionOptions struct { Duration time.Duration IsolationLevel IsolationLevel ReadOnly bool }
TransactionOptions :
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 (*UpdateOneOptions) SetDebug ¶
func (opt *UpdateOneOptions) SetDebug(debug bool) *UpdateOneOptions
SetDebug :
type UpdateOptions ¶
type UpdateOptions struct {
Debug bool
}
UpdateOptions :
func (*UpdateOptions) SetDebug ¶
func (opt *UpdateOptions) SetDebug(debug bool) *UpdateOptions
SetDebug :