Documentation ¶
Index ¶
- Constants
- type BuildInfo
- type Configuration
- func (c *Configuration) GetDataConfig() DbConfig
- func (c *Configuration) GetDataSource() *sql.DB
- func (c *Configuration) GetMappedStatementMap() map[string]MappedStatement
- func (c *Configuration) SetDataConfig(in DbConfig)
- func (c *Configuration) SetDataSource(db *sql.DB)
- func (c *Configuration) SetMappedStatementMap(m map[string]MappedStatement)
- type DbConfig
- type MappedStatement
- type XmlDelete
- type XmlInsert
- type XmlMapper
- type XmlSelect
- type XmlUpdate
Constants ¶
View Source
const ( SELECT string = "select" UPDATE string = "update" INSERT string = "insert" DELETE string = "delete" )
View Source
const (
DataCapacity int = 1000 // DataCapacity 默认数据容量
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildInfo ¶
type BuildInfo struct { DbConfig DbConfig // 数据库配置信息 MapperXmlDir [][]byte // 包含mapperXml的文件夹信息, 为了安全性能考虑,建议mapperXml使用embed,打包时将相关文件打包到可执行文件中。 }
BuildInfo
- 定义两个文件类型,一个是数据库的配置信息
- 另一个是mapperXml对应的文件信息
- 使用时只需将这两文件对应的文件流传入即可。
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration
- 保存数据库源和sql映射关系属性
func (*Configuration) GetDataConfig ¶
func (c *Configuration) GetDataConfig() DbConfig
func (*Configuration) GetDataSource ¶
func (c *Configuration) GetDataSource() *sql.DB
func (*Configuration) GetMappedStatementMap ¶
func (c *Configuration) GetMappedStatementMap() map[string]MappedStatement
func (*Configuration) SetDataConfig ¶
func (c *Configuration) SetDataConfig(in DbConfig)
func (*Configuration) SetDataSource ¶
func (c *Configuration) SetDataSource(db *sql.DB)
func (*Configuration) SetMappedStatementMap ¶
func (c *Configuration) SetMappedStatementMap(m map[string]MappedStatement)
type MappedStatement ¶
type MappedStatement struct { Id string //标识 ResultType string // 返回类型 ParamType string // 参数类型 Sql string // sql语句 SqlType string // sql操作类型: 增,删,改,查 DataBase string // sql标识,用于适配不同数据库的sql语句 }
MappedStatement
- mapper.xml 映射属性实体
func (MappedStatement) IsEmpty ¶
func (m MappedStatement) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.