Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointMySQL ¶
type EndpointPostgres ¶
type EndpointSQLite ¶
type Option ¶
type Option[A any] struct { // AutoMigration if enable auto migration AutoMigration bool `url:"-"` // DryRun migration with dry run mode DryRun bool `url:"-"` // CreateTableOnly just do table creations without column diff and modifications CreateTableOnly bool `url:"-"` // MaxOpenConns the upper limit on open connections. this should be tuned // based on both application concurrency and database server capacity. // a typical recommendation is 2-4 times the number of CPU cores of database // sever. MaxOpenConns int `url:"-"` // MaxIdleConns is recommended to be set to the same value as MaxOpenConns. MaxIdleConns int `url:"-"` // ConnMaxLifetime is recommended to be 0.5 to 1 hour. // NOTE: it should lower than sever-side `wait_timeout` setting. (eg: MySQL's `wait_timeout`) . // server-side controls the maximum duration connection remains open while idle. ConnMaxLifetime types.Duration `url:"-"` // ConnMaxIdleTime is recommended to be 5 to 10 minutes to release rapidly of // reclaim connection resources. ConnMaxIdleTime types.Duration `url:"-"` // Name denotes a globally **unique** identifier for a database endpoint and // its lifecycle sessions. Name string `url:"-"` // AdaptorOption for different driver. eg mysql, postgres etc. AdaptorOption A `url:",inline"` }
func (*Option[A]) SetDefault ¶
func (o *Option[A]) SetDefault()
Click to show internal directories.
Click to hide internal directories.