xorm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Debug(ctx context.Context) Core

	Model(ctx context.Context, value interface{}) Core
	Select(ctx context.Context, query interface{}, args ...interface{}) Core
	Where(ctx context.Context, query interface{}, args ...interface{}) Core
	Not(ctx context.Context, query interface{}, args ...interface{}) Core
	Or(ctx context.Context, query interface{}, args ...interface{}) Core
	Joins(ctx context.Context, query string, args ...interface{}) Core
	Group(ctx context.Context, name string) Core
	Order(ctx context.Context, value interface{}) Core
	Limit(ctx context.Context, limit int) Core
	Offset(ctx context.Context, offset int) Core
	Unscoped(ctx context.Context) Core
	Raw(ctx context.Context, sql string, values ...interface{}) Core
}

type Core

type Core interface {
	Builder

	Insert(ctx context.Context, value interface{}) error
	InsertBulk(ctx context.Context, value interface{}, batchSize int) error
	InsertIgnore(ctx context.Context, value interface{}) error
	InsertBulkIgnore(ctx context.Context, value interface{}, batchSize int) error

	Delete(ctx context.Context, value interface{}, conds ...interface{}) error

	Update(ctx context.Context, column string, value interface{}) error
	Updates(ctx context.Context, value map[string]interface{}) error

	Exec(ctx context.Context, query string, args ...interface{}) (rst sql.Result, err error)
	Query(ctx context.Context, query string, args ...interface{}) (rows *Rows, err error)
	QueryRow(ctx context.Context, query string, args ...interface{}) (row *Row, err error)

	First(ctx context.Context, dest interface{}, conds ...interface{}) error
	Find(ctx context.Context, dest interface{}, conds ...interface{}) error
	Count(ctx context.Context, count *int64) error
}

type ORM

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

func (*ORM) Count

func (x *ORM) Count(ctx context.Context, count *int64) error

func (*ORM) Debug

func (x *ORM) Debug(ctx context.Context) Core

func (*ORM) Delete

func (x *ORM) Delete(ctx context.Context, value interface{}, conds ...interface{}) error

func (*ORM) Exec

func (x *ORM) Exec(ctx context.Context, query string, args ...interface{}) (rst sql.Result, err error)

func (*ORM) Find

func (x *ORM) Find(ctx context.Context, dest interface{}, conds ...interface{}) error

func (*ORM) First

func (x *ORM) First(ctx context.Context, dest interface{}, conds ...interface{}) error

func (*ORM) Group

func (x *ORM) Group(ctx context.Context, name string) Core

func (*ORM) Insert

func (x *ORM) Insert(ctx context.Context, value interface{}) error

func (*ORM) InsertBulk

func (x *ORM) InsertBulk(ctx context.Context, value interface{}, batchSize int) error

func (*ORM) InsertBulkIgnore

func (x *ORM) InsertBulkIgnore(ctx context.Context, value interface{}, batchSize int) error

func (*ORM) InsertIgnore

func (x *ORM) InsertIgnore(ctx context.Context, value interface{}) error

func (*ORM) Joins

func (x *ORM) Joins(ctx context.Context, query string, args ...interface{}) Core

func (*ORM) Limit

func (x *ORM) Limit(ctx context.Context, limit int) Core

func (*ORM) Model

func (x *ORM) Model(ctx context.Context, value interface{}) Core

func (*ORM) Not

func (x *ORM) Not(ctx context.Context, query interface{}, args ...interface{}) Core

func (*ORM) Offset

func (x *ORM) Offset(ctx context.Context, offset int) Core

func (*ORM) Or

func (x *ORM) Or(ctx context.Context, query interface{}, args ...interface{}) Core

func (*ORM) Order

func (x *ORM) Order(ctx context.Context, value interface{}) Core

func (*ORM) Query

func (x *ORM) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)

func (*ORM) QueryRow

func (x *ORM) QueryRow(ctx context.Context, query string, args ...interface{}) (*Row, error)

func (*ORM) Raw

func (x *ORM) Raw(ctx context.Context, sql string, values ...interface{}) Core

func (*ORM) Select

func (x *ORM) Select(ctx context.Context, query interface{}, args ...interface{}) Core

func (*ORM) Tx

func (x *ORM) Tx(ctx context.Context, f func(context.Context) error) error

func (*ORM) Unscoped

func (x *ORM) Unscoped(ctx context.Context) Core

func (*ORM) Update

func (x *ORM) Update(ctx context.Context, column string, value interface{}) error

func (*ORM) Updates

func (x *ORM) Updates(ctx context.Context, value map[string]interface{}) error

func (*ORM) Where

func (x *ORM) Where(ctx context.Context, query interface{}, args ...interface{}) Core

type ORMItf

type ORMItf interface {
	Core
	Tx(ctx context.Context, f func(context.Context) error) error
}

func New

func New(orm *gorm.DB) ORMItf

type Row

type Row struct {
	*sql.Row
}

func (*Row) Scan

func (r *Row) Scan(desc ...interface{}) error

type Rows

type Rows struct{ *sql.Rows }

func (*Rows) Scan

func (r *Rows) Scan(desc ...interface{}) error

type TxORM

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

func (*TxORM) Commit

func (x *TxORM) Commit() error

func (*TxORM) Count

func (x *TxORM) Count(ctx context.Context, count *int64) error

func (*TxORM) Debug

func (x *TxORM) Debug(_ context.Context) Core

func (*TxORM) Delete

func (x *TxORM) Delete(ctx context.Context, value interface{}, conds ...interface{}) error

func (*TxORM) Exec

func (x *TxORM) Exec(ctx context.Context, query string, args ...interface{}) (rst sql.Result, err error)

func (*TxORM) Find

func (x *TxORM) Find(ctx context.Context, dest interface{}, conds ...interface{}) error

func (*TxORM) First

func (x *TxORM) First(ctx context.Context, dest interface{}, conds ...interface{}) error

func (*TxORM) Group

func (x *TxORM) Group(_ context.Context, name string) Core

func (*TxORM) Insert

func (x *TxORM) Insert(ctx context.Context, value interface{}) error

func (*TxORM) InsertBulk

func (x *TxORM) InsertBulk(ctx context.Context, value interface{}, batchSize int) error

func (*TxORM) InsertBulkIgnore

func (x *TxORM) InsertBulkIgnore(ctx context.Context, value interface{}, batchSize int) error

func (*TxORM) InsertIgnore

func (x *TxORM) InsertIgnore(ctx context.Context, value interface{}) error

func (*TxORM) Joins

func (x *TxORM) Joins(_ context.Context, query string, args ...interface{}) Core

func (*TxORM) Limit

func (x *TxORM) Limit(_ context.Context, limit int) Core

func (*TxORM) Model

func (x *TxORM) Model(_ context.Context, value interface{}) Core

func (*TxORM) Not

func (x *TxORM) Not(_ context.Context, query interface{}, args ...interface{}) Core

func (*TxORM) Offset

func (x *TxORM) Offset(_ context.Context, offset int) Core

func (*TxORM) Or

func (x *TxORM) Or(_ context.Context, query interface{}, args ...interface{}) Core

func (*TxORM) Order

func (x *TxORM) Order(_ context.Context, value interface{}) Core

func (*TxORM) Query

func (x *TxORM) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)

func (*TxORM) QueryRow

func (x *TxORM) QueryRow(ctx context.Context, query string, args ...interface{}) (*Row, error)

func (*TxORM) Raw

func (x *TxORM) Raw(_ context.Context, sql string, values ...interface{}) Core

func (*TxORM) Rollback

func (x *TxORM) Rollback() error

func (*TxORM) Select

func (x *TxORM) Select(_ context.Context, query interface{}, args ...interface{}) Core

func (*TxORM) Tx

func (x *TxORM) Tx(f func() error) (err error)

func (*TxORM) Unscoped

func (x *TxORM) Unscoped(_ context.Context) Core

func (*TxORM) Update

func (x *TxORM) Update(ctx context.Context, column string, value interface{}) error

func (*TxORM) Updates

func (x *TxORM) Updates(ctx context.Context, value map[string]interface{}) error

func (*TxORM) Where

func (x *TxORM) Where(_ context.Context, query interface{}, args ...interface{}) Core

type TxORMItf

type TxORMItf interface {
	Core
	Rollback() error
	Commit() error
	Tx(f func() error) error
}

Jump to

Keyboard shortcuts

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