Crate mysql_quick
source ·Macros
- 计数 ,返回 sql 语句,参数同 find 类似。 Count, get back sql, the params same as find.
- 通过id,删除数据 ,返回 sql 语句。 Delete one data by id (default).
- 查寻数据,返回sql
- 获取一条数据,一定要记录传
select
的字段且不能为* - 新增数据 ,返回 sql 语句。 下面示例中,user 为表名,,name、num 为字段名,,后面为新增的值。 Add new data, then return sql. exp: users table, field name and num. after them is value.
- 批量新增数据 ,返回 sql 语句。 下面示例中,user 为表名,,name、num 为字段名,,后面为新增的值。
- 1.通过id,更新数据 ,返回 sql 语句。 Update one data by id (default).
- 1.单个条件,批量更新数据 ,返回 sql 语句。
Structs
- Pooled mysql connection which will return to the pool on
drop
. - MySql transaction options.
Constants
- 悲观锁,用于抢单什么的
- 常用的 mysql 锁类型。直接加在 sql 语句后面
Traits
- Something, that eventually is a
Statement
in the context of aT: Queryable
. - Helper trait for batch statement execution.
- MySql prepared statement query.
- Things that may be used as an index of a row column.
- Basic operations on
FromValue
conversion intermediate result. - Trait to convert
Row
into a tuple ofFromValue
implementors up to arity 12. - Implement this trait to convert value to something.
- Trait for protocol markers
crate::Binary
andcrate::Text
. - Queryable object.
- MySql text query.
- Helper, that constructs
QueryWithParams
.
Functions
- my_runDeprecated运行sql语句,返回想要的结果
- 运行sql语句,返回最近一条语句的数据id,如果上没有,则返回0,用于set返回对应的id。 其他方法mydel、mysetmany、myupdate,则不用管这个id。
- my_run_tranDeprecated事务执行
- 事务执行
- 事务执行
- 运行sql语句,返回想要的结果