package
0.0.0-20250221025053-c3ab81728e88
Repository: https://github.com/denglitong/golang.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
BatchDelete If the specified value has no primary value, GORM will perform a batch delete, it will delete all matched records.
If we haven't specified a record primary key, GORM will perform a batch update.
BlockGlobalDelete If you perform a batch delete without any conditions, GORM won't run it, and will return ErrMissingWhereClause error.
No description provided by the author
No description provided by the author
No description provided by the author
Clauses GORM uses SQL builder generates SQL internally, for each operation, GORM creates a *gorm.Statement object, all GORM APIs add/change Clause for the Statement, at last, GORM generated SQL based on those clauses.
Connection Run multiple SQL in same db tcp connection (not in transaction).
No description provided by the author
No description provided by the author
DeleteFlag By default, gorm.Model users *time.Time as the value for the DeletedAt field, and it provides other data formats support with plugin gorm.io/plugin/soft_delete.
No description provided by the author
No description provided by the author
DryRunMode Generate SQL and its arguments without executing, can be used to prepare or test generated SQL.
No description provided by the author
No description provided by the author
FindToMap GORM allows scanning results to map[string]interface{} or []map[string]interface{}, don't forget to specify Model or Table.
FirstOrCreate Get first matched record or create a new one with given conditions (only works with struct, map conditions), RowsAffected returns created/updated record's count.
FirstOrInit Get first matched record or initialize a new instance with given conditions, only works with struct or map conditions.
No description provided by the author
No description provided by the author
No description provided by the author
If you need to accept runtime arguments, then you can return func.
No description provided by the author
No description provided by the author
Pluck Query single column from database and scan into a slice, if you want to query multiple columns, use Select with Scan/Find instead.
RawSQL Query raw sql with Scan.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Scopes allows you to specify commonly-used queries which can be referenced as method calls.
ShowCreate show db creation cases.
No description provided by the author
SoftDelete If your model includes a `gorm.DeletedAt` field (which is included in gorm.model), it will get soft delete ability automatically! when calling Delete, the record won't be removed from the database, but GORM will set the `DeletedAt`'s value to the current time, and the data is not findable with normal Query methods anymore.
No description provided by the author
ToSQL Returns generated SQL without executing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithoutHooksOrTimeTrack If you want to skip Hooks and don't track the update time when updating, you can use UpdateColumn, UpdateColumns, it works like Update, Updates.