gorm

package
v0.0.0-...-636a0eb Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

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

func (*Configuration) Build

func (c *Configuration) Build() interface{}

func (*Configuration) Configer

func (c *Configuration) Configer() internal.Configer

func (*Configuration) Dsn

func (c *Configuration) Dsn() string

func (*Configuration) Logger

func (c *Configuration) Logger() facade_logger.Logger

func (*Configuration) NowFunc

func (c *Configuration) NowFunc() func() time.Time

func (*Configuration) SetDryRun

func (c *Configuration) SetDryRun(dryRun bool) error

func (*Configuration) SetDsn

func (c *Configuration) SetDsn(dsn string) error

func (*Configuration) SetLogger

func (c *Configuration) SetLogger(logger facade_logger.Logger) error

func (*Configuration) SetNowFunc

func (c *Configuration) SetNowFunc(nowFunc func() time.Time) error

func (*Configuration) SetSlowSqlThreshold

func (c *Configuration) SetSlowSqlThreshold(threshold time.Duration) error

func (*Configuration) SlowSqlThreshold

func (c *Configuration) SlowSqlThreshold() (threshold time.Duration)

type Connection

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

func (*Connection) Client

func (c *Connection) Client() interface{}

func (*Connection) Connect

func (c *Connection) Connect() error

func (*Connection) Connector

func (c *Connection) Connector() internal.Connector

func (*Connection) Disconnect

func (c *Connection) Disconnect() error

func (*Connection) SetConfiger

func (c *Connection) SetConfiger(configer internal.Configer)

type Database

type Database struct {
	Connection
	Query
}

func (*Database) New

func (d *Database) New() internal.Databaser

type Log

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

func NewLog

func NewLog(logger facade_logger.Logger, slowThreshold time.Duration) *Log

func (*Log) Error

func (l *Log) Error(ctx context.Context, s string, i ...interface{})

func (*Log) Info

func (l *Log) Info(ctx context.Context, s string, i ...interface{})

func (*Log) LogMode

func (l *Log) LogMode(level logger.LogLevel) logger.Interface

func (*Log) SlowThreshold

func (l *Log) SlowThreshold() time.Duration

func (*Log) Trace

func (l *Log) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*Log) Warn

func (l *Log) Warn(ctx context.Context, s string, i ...interface{})

type Query

type Query struct {
	common.QueryPrepareBindings
	common.TransactionExceptionHandler
	// contains filtered or unexported fields
}

func (*Query) Delete

func (q *Query) Delete(query string, bindings ...interface{}) (affectedRows int64, err error)

func (*Query) Fork

func (q *Query) Fork(clientPtr interface{}) facade.Queryer

func (*Query) Insert

func (q *Query) Insert(query string, bindings ...interface{}) (lastInsertId int64, err error)

func (*Query) Pretend

func (q *Query) Pretend(callbackFunc func(db facade.Queryer) interface{}) (callbackReturn interface{})

func (*Query) Raw

func (q *Query) Raw(query string, bindings ...interface{}) facade.Scanner

func (*Query) Select

func (q *Query) Select(query string, bindings ...interface{}) facade.Scanner

func (*Query) SelectOne

func (q *Query) SelectOne(query string, bindings ...interface{}) facade.OneScanner

func (*Query) SetConnector

func (q *Query) SetConnector(connector internal.Connector)

func (*Query) SetLogger

func (q *Query) SetLogger(logger facade_logger.Logger) error

func (*Query) Statement

func (q *Query) Statement(query string, bindings ...interface{}) (affectedRows int64, err error)

func (*Query) Transaction

func (q *Query) Transaction(transactionFunc func(tx facade.Queryer) error, attempts uint)

func (*Query) TransactionBegin

func (q *Query) TransactionBegin() facade.Queryer

func (*Query) TransactionCommit

func (q *Query) TransactionCommit() error

func (*Query) TransactionRollBack

func (q *Query) TransactionRollBack() error

func (*Query) Unprepared

func (q *Query) Unprepared(query string) facade.Scanner

func (*Query) Update

func (q *Query) Update(query string, bindings ...interface{}) (affectedRows int64, err error)

type Scan

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

func (*Scan) Scan

func (s *Scan) Scan(dest interface{}) error

func (*Scan) ScanRows

func (s *Scan) ScanRows(rows *sql.Rows, dest interface{}) error

Jump to

Keyboard shortcuts

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