Crate mysql_quick
source ·Macros
- 计数 ,返回 sql 语句,参数同 find 类似。
- 通过id,删除数据 ,返回 sql 语句。
- 查寻数据,返回sql
- 获取一条数据,一定要记录传
select
的字段且不能为* - 新增数据 ,返回 sql 语句。 下面示例中,user 为表名,,name、num 为字段名,,后面为新增的值。
- 批量新增数据 ,返回 sql 语句。 下面示例中,user 为表名,,name、num 为字段名,,后面为新增的值。
- 1.通过id,更新数据 ,返回 sql 语句。
- 1.单个条件,批量更新数据 ,返回 sql 语句。
Structs
- Pooled mysql connection.
- 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.
- Trait to convert
Row
into a tuple ofFromValue
implementors up to arity 12. - Implement this trait to convert a value to some type.
- Trait for protocol markers [
crate::Binary
] and [crate::Text
]. - Queryable object.
- MySql text query.
- Helper, that constructs
QueryWithParams
.
Functions
- 运行sql语句,返回最近一条语句的数据id,如果上没有,则返回0,用于set返回对应的id。 其他方法mydel、mysetmany、myupdate,则不用管这个id。
- 事务执行
- 事务执行
- 运行sql语句,返回想要的结果
Derive Macros
- Derives
FromRow
. Seemysql_common
crate-level docs for more info. - Derives
FromValue
. Seemysql_common
crate-level docs for more info.