Documentation ¶
Index ¶
- type Dalgorm
- func (d *Dalgorm) AddColumn(table, columnName, columnType string) errors.Error
- func (d *Dalgorm) All(dst interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) AllTables() ([]string, errors.Error)
- func (d *Dalgorm) AutoMigrate(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) Count(clauses ...dal.Clause) (int64, errors.Error)
- func (d *Dalgorm) Create(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) CreateIfNotExist(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) CreateOrUpdate(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) Cursor(clauses ...dal.Clause) (*sql.Rows, errors.Error)
- func (d *Dalgorm) CursorTx(clauses ...dal.Clause) *gorm.DB
- func (d *Dalgorm) Delete(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) Dialect() string
- func (d *Dalgorm) DropColumn(table, columnName string) errors.Error
- func (d *Dalgorm) Exec(query string, params ...interface{}) errors.Error
- func (d *Dalgorm) Fetch(cursor *sql.Rows, dst interface{}) errors.Error
- func (d *Dalgorm) First(dst interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) GetColumns(dst schema.Tabler, filter func(columnMeta dal.ColumnMeta) bool) (cms []dal.ColumnMeta, _ errors.Error)
- func (d *Dalgorm) GetPrimaryKeyFields(t reflect.Type) []reflect.StructField
- func (d *Dalgorm) Pluck(column string, dest interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) RawCursor(query string, params ...interface{}) (*sql.Rows, errors.Error)
- func (d *Dalgorm) Update(entity interface{}, clauses ...dal.Clause) errors.Error
- func (d *Dalgorm) UpdateColumns(entity interface{}, clauses ...dal.Clause) errors.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dalgorm ¶
type Dalgorm struct {
// contains filtered or unexported fields
}
Dalgorm FIXME ...
func (*Dalgorm) AutoMigrate ¶
AutoMigrate runs auto migration for given models
func (*Dalgorm) CreateIfNotExist ¶
CreateIfNotExist tries to create the record if not exist
func (*Dalgorm) CreateOrUpdate ¶
CreateOrUpdate tries to create the record, or fallback to update all if failed
func (*Dalgorm) Cursor ¶
Cursor returns a database cursor, cursor is especially useful when handling big amount of rows of data
func (*Dalgorm) DropColumn ¶ added in v0.14.0
DropColumn drop one column from the table
func (*Dalgorm) First ¶
First loads first matched row from database to `dst`, error will be returned if no records were found
func (*Dalgorm) GetColumns ¶
func (d *Dalgorm) GetColumns(dst schema.Tabler, filter func(columnMeta dal.ColumnMeta) bool) (cms []dal.ColumnMeta, _ errors.Error)
GetColumns FIXME ...
func (*Dalgorm) GetPrimaryKeyFields ¶
func (d *Dalgorm) GetPrimaryKeyFields(t reflect.Type) []reflect.StructField
GetPrimaryKeyFields get the PrimaryKey from `gorm` tag
Click to show internal directories.
Click to hide internal directories.