AutoMigrate runs auto migration for given models
(entity interface{}, clauses ...dal.Clause)
| 174 | |
| 175 | // AutoMigrate runs auto migration for given models |
| 176 | func (d *Dalgorm) AutoMigrate(entity interface{}, clauses ...dal.Clause) errors.Error { |
| 177 | d.unwrapDynamic(&entity, &clauses) |
| 178 | err := buildTx(d.db, clauses).AutoMigrate(entity) |
| 179 | if err == nil { |
| 180 | // fix pg cache plan error |
| 181 | _ = d.First(entity, clauses...) |
| 182 | } |
| 183 | return d.convertGormError(err) |
| 184 | } |
| 185 | |
| 186 | // Cursor returns a database cursor, cursor is especially useful when handling big amount of rows of data |
| 187 | func (d *Dalgorm) Cursor(clauses ...dal.Clause) (dal.Rows, errors.Error) { |
nothing calls this directly
no test coverage detected