Documentation ¶
Index ¶
- func BuildDataSource(c ModelxConfig) string
- func MustSqlxConn(c ModelxConfig) sqlx.SqlConn
- func WithCacheConf(cacheConf cache.CacheConf) opts.Opt[ModelOpts]
- func WithCacheOpts(cacheOpts ...cache.Option) opts.Opt[ModelOpts]
- func WithCachedConn(cachedConn sqlc.CachedConn) opts.Opt[ModelOpts]
- type DatabaseConf
- type ModelOpts
- type ModelxConfig
- type MysqlConf
- type SqliteConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDataSource ¶ added in v0.15.0
func BuildDataSource(c ModelxConfig) string
func MustSqlxConn ¶ added in v0.15.0
func MustSqlxConn(c ModelxConfig) sqlx.SqlConn
func WithCachedConn ¶ added in v0.9.1
func WithCachedConn(cachedConn sqlc.CachedConn) opts.Opt[ModelOpts]
Types ¶
type DatabaseConf ¶ added in v0.15.0
type ModelOpts ¶
type ModelOpts struct { CachedConn *sqlc.CachedConn CacheConf cache.CacheConf CacheOpts []cache.Option }
func (ModelOpts) DefaultOptions ¶
type ModelxConfig ¶ added in v0.15.0
type ModelxConfig struct { DatabaseType string `json:"databaseType,default=mysql"` Mysql MysqlConf `json:"mysql,"` Sqlite SqliteConf `json:"sqlite,"` }
type MysqlConf ¶ added in v0.15.0
type MysqlConf struct {
DatabaseConf
}
type SqliteConf ¶ added in v0.15.0
type SqliteConf struct {
Path string `json:"path,default=data.db"`
}
Click to show internal directories.
Click to hide internal directories.