Documentation ¶
Index ¶
- Constants
- type Database
- type MongoDB
- type MysqlDB
- func (mysqldb *MysqlDB) Connect() error
- func (mysqldb *MysqlDB) FillAutoNestedSingle(targetTable string, data interface{}) error
- func (mysqldb *MysqlDB) FillAutoPlainMultiple(targetTable string, data []interface{}) error
- func (mysqldb *MysqlDB) FillAutoPlainSingle(targetTable string, data interface{}) (int64, error)
Constants ¶
View Source
const ( TagRelationName = "relation_name" TagBulker = "bulker" TagUnique = "bulker_unique" TagBulkerType = "bulker_type" TagBulkerRDB = "bulker_rdb" TagBulkerColumn = "bulker_column" TagTable = "table" CommaToken = "," RightParanthesisToken = ")" LeftParanthesisToken = "(" ValuesToken = "VALUES" )
View Source
const ( InsertTemplate = "INSERT INTO %s (%s) VALUES %s" CreateTableTemplate = "CREATE TABLE IF NOT EXISTS %s (%s)" PrimaryKeyTemplate = "PRIMARY KEY (`%s`)" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct { ConnectionString string Database string // contains filtered or unexported fields }
func NewMongoDBClient ¶
NewMongoDBClient create MongoDB client, connect to db and return MongoDB
type MysqlDB ¶
type MysqlDB struct { ConnectionString string Database string // contains filtered or unexported fields }
func NewMysqlClient ¶
NewMysqlClient create MysqlDB client, connect to db and return MysqlDB
func (*MysqlDB) FillAutoNestedSingle ¶
FillAutoNestedSingle, writes given data to the given table create table for nested objects if any and returns the last inserted id and error if any. Create automatically relations.
func (*MysqlDB) FillAutoPlainMultiple ¶
FillAutoPlainMultiple writes multiple given data to given table and returns an error if any Ignore any nested child.
Click to show internal directories.
Click to hide internal directories.