Categorygithub.com/cloudfly/ormx
modulepackage
0.5.0
Repository: https://github.com/cloudfly/ormx.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
Build is same with builder.Build, but it will try to inject namespace(which defined in context) filter into where condition in sql.
Close the connections to the database server in driver.
ColNamesWithTagOpt will column names from structure data, the type of d must be a struct, otherwise will return []string{}.
Connect to the database server by using the addr and password specified in flags.
Count select the count of rows in table which match the filter condition.
Count select the count of rows in table which match the filter condition.
DefaultProvider return the sqlx.DB created by Connect().
DeleteWhere delete rows by id from the given table.
DeleteWhere delete rows by id in transaction from the table.
DeleteWhere delete rows that match the filter from the given table.
DeleteWhereTx delete rows that match the filter in transaction from the given table.
Distinct fetch distinct values of the column in table.
Exec execute a sql on master DB.
Exec execute a sql in transaction.
Exist return true if the at least one row found in table by using where condition.
FromMaster force ormx execute sql on master instance when called by this context.
FromMaster force ormx execute sql on slave instance when called by this context.
Get will get one data into dest with raw sql and args.
No description provided by the author
Get will get one data from tx by using raw sql and args.
GetWhere 使用自定义条件跟新数据.
IgnnoreNamespace force ormx ignore the namespace info in context, so that Build will not inject namespace filter in sql.
Init the ormx, setting the sqlx.DB getter and common table name prefix.
InsertIgnore insert new data into database and ingore the rows on duplicate keys.
InsertIgnoreTx insert new data into database and ingore the rows on duplicate keys using transaction.
InsertManyTx insert rows in transaction, the all data type should be same structure.
InsertManyTx insert rows in transaction, the all data type should be same structure.
InsertOneTx insert rows into table, the data type should be structure.
InsertOneTx insert rows in transaction, the data type should be structure.
IsDuplicate 判断查询错误是否是 未找到错误.
IsNotFound 判断查询错误是否是 未找到错误.
KVsFromMap generate KVs from map.
Master return master *sqlx.DB which returned by DBProvider, panic if DBProvider is not Initilized.
NewInsertBuilderFromStruct create a new insert builder from data, the struct field with 'insert' option in field tag will be inserted such as: db:"columnName,insert" or db:",insert" the struct field with no insert tag option, will be ignored.
NewSelectBuilderFromStruct create select sql builder by data.
NewUpdateBuilderFromStruct 使用 data 数据定义 update builder.
ParseOptionStr will decode key-value data from a string which format like k1:v1,k2:v2,k3:v3.
PatchByID updates the data by id in the table.
PatchByIDTx updates the data by id in the table using a transaction.
PatchWhere updates the data that match the filter in the table.
PatchWhereTx updates the data that matchthe filter in the table using a transaction.
RunTxContext execute a transiction.
Select will query data into dest with raw sql and args.
Select will query data into dest with raw sql and args.
GetWhere 使用自定义条件跟新数据.
No description provided by the author
No description provided by the author
SetNamespaceColumnName set the common namespace colunm name, default is 'namespace'; ormx will auto inject namespace where condition into sql.// Set to empty string disable this feature.
SetPrimaryKey set the primary column name, default is 'id'.
SetStructTagName set the tag name in Go Struct Tag, in which specify the ormx options, default is 'db'.
Master return slave *sqlx.DB which returned by DBProvider, panic if DBProvider is not Initilized.
TableName auto recoganize the table name from data, it will auto prepend the tableNamePrefix which can be set by SetTableNamePrefix to the result.
No description provided by the author
No description provided by the author
No description provided by the author
WhereFromStruct generate where exprs from []KV, the returned value can be used by builder.Where method.
WhereFromStruct generate where exprs from data(type of struct), the returned value can be used by builder.Where method.
WithNamespace add namespace info into context.

# Variables

No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

DBProvider.
No description provided by the author
No description provided by the author