Documentation
¶
Index ¶
- func New(opts ...Option) *gorm.DB
- type Option
- func WithAllowGlobalUpdate(allowGlobalUpdate bool) Option
- func WithApplicationName(applicationName string) Option
- func WithClauseBuilders(clauseBuilders map[string]clause.ClauseBuilder) Option
- func WithConnPool(connPool gorm.ConnPool) Option
- func WithCreateBatchSize(createBatchSize int) Option
- func WithDb(db string) Option
- func WithDefaultContextTimeout(defaultContextTimeout time.Duration) Option
- func WithDefaultTransactionTimeout(defaultTransactionTimeout time.Duration) Option
- func WithDisableAutomaticPing(disableAutomaticPing bool) Option
- func WithDisableForeignKeyConstraintWhenMigrating(disableForeignKeyConstraintWhenMigrating bool) Option
- func WithDisableNestedTransaction(disableNestedTransaction bool) Option
- func WithDryRun(dryRun bool) Option
- func WithFullSaveAssociations(fullSaveAssociations bool) Option
- func WithHost(host string) Option
- func WithIgnoreRelationshipsWhenMigrating(ignoreRelationshipsWhenMigrating bool) Option
- func WithLogger(logger loggerGorm.Interface) Option
- func WithNamingStrategy(namingStrategy schema.Namer) Option
- func WithNowFunc(nowFunc func() time.Time) Option
- func WithPassword(password string) Option
- func WithPlugins(plugins map[string]gorm.Plugin) Option
- func WithPort(port int) Option
- func WithPrepareStmt(prepareStmt bool) Option
- func WithPrepareStmtMaxSize(prepareStmtMaxSize int) Option
- func WithPrepareStmtTTL(prepareStmtTTL time.Duration) Option
- func WithPropagateUnscoped(propagateUnscoped bool) Option
- func WithQueryFields(queryFields bool) Option
- func WithSearchPath(searchPath string) Option
- func WithSkipDefaultTransaction(skipDefaultTransaction bool) Option
- func WithSsl(ssl string) Option
- func WithTranslateError(translateError bool) Option
- func WithUser(user string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*client)
func WithAllowGlobalUpdate ¶
func WithApplicationName ¶
func WithClauseBuilders ¶
func WithClauseBuilders(clauseBuilders map[string]clause.ClauseBuilder) Option
func WithConnPool ¶
func WithCreateBatchSize ¶
CreateBatchSize default create batch size
func WithFullSaveAssociations ¶
FullSaveAssociations full save associations
func WithLogger ¶
func WithLogger(logger loggerGorm.Interface) Option
func WithNamingStrategy ¶
NamingStrategy tables, columns naming strategy
func WithNowFunc ¶
func WithPassword ¶
func WithPrepareStmt ¶
PrepareStmt executes the given query in cached statement
func WithPrepareStmtMaxSize ¶
PrepareStmt cache support LRU expired, default maxsize=int64 Max value and ttl=1h
func WithPrepareStmtTTL ¶
func WithPropagateUnscoped ¶
PropagateUnscoped propagate Unscoped to every other nested statement
func WithQueryFields ¶
QueryFields executes the SQL query with all fields of the table
func WithSearchPath ¶
func WithSkipDefaultTransaction ¶
GORM perform single create, update, delete operations in transactions by default to ensure database data integrity
func WithTranslateError ¶
TranslateError enabling error translation
Click to show internal directories.
Click to hide internal directories.