Documentation ¶
Index ¶
- Constants
- Variables
- func BuildQuery(conds Conds) (sql string, binds []interface{})
- func DefaultConfig() *config
- type Association
- type Component
- type Cond
- type Conds
- type Container
- type DB
- type Dialector
- type Field
- type Handler
- type Interceptor
- type Logger
- type Model
- type NamingStrategy
- type Option
- type Processor
Constants ¶
View Source
const PackageName = "component.egorm"
PackageName ...
Variables ¶
View Source
var ( // ErrRecordNotFound returns a "record not found error". Occurs only when attempting to query the database with a struct; querying with a slice won't return this error ErrRecordNotFound = gorm.ErrRecordNotFound )
Functions ¶
func BuildQuery ¶ added in v0.2.1
BuildQuery 根据conds构建sql和绑定的参数
Types ¶
type Cond ¶ added in v0.2.1
type Cond struct { // Op MySQL中查询条件,如like,=,in Op string // Val 查询条件对应的值 Val interface{} }
Cond 为字段查询结构体
type Conds ¶ added in v0.2.1
type Conds map[string]interface{}
Conds 为Cond类型map,用于定义Where方法参数 map[field.name]interface{}
type Interceptor ¶
type Interceptor func(string, *manager.DSN, string, *config, *elog.Component) func(next Handler) Handler
Interceptor ...
type NamingStrategy ¶ added in v0.2.0
type NamingStrategy = schema.NamingStrategy
NamingStrategy ...
type Option ¶
type Option func(c *Container)
Option 可选项
func WithDSNParser ¶ added in v0.2.0
WithDSNParser 设置自定义dsnParser
Source Files ¶
Click to show internal directories.
Click to hide internal directories.