pub type Insert<'a, ET> = Insert<'a, ET, MySql, DataKind>;Expand description
Insert builder type alias for MySQL
MySQL 的 Insert 构建器类型别名
Used to build INSERT statements for MySQL databases. Provides methods to insert single or multiple records in a type-safe manner.
用于为 MySQL 数据库构建 INSERT 语句。提供以类型安全的方式插入单个或多个记录的方法。
§Type Parameters
ET- The entity type that this insert builder operates onET- 此插入构建器操作的实体类型
§Public Methods
one- Create single record insert operationmany- Create multiple records insert operationtable- Create custom table and columnswith_table- Create a insert with a custom table namefrom_query- Create an Insert instance from a queryfrom_query_with_table- Create an Insert instance from a query with a custom table namecustom- Custom VALUES or value-related query statementsfinish- Finish building, get the internal QueryBuilder
§公共方法
one- 创建单条记录插入操作many- 创建多条记录插入操作table- 创建默认表名的插入操作with_table- 创建带有自定义表名的插入操作from_query- 从外部查询中创建 Insert 实例from_query_with_table- 从外部查询中创建 Insert 实例,可以自定义表名custom- 自定义 VALUES 或值相关的查询语句finish- 结束构建,获取内部的 QueryBuilder
§Examples
use kitx::mysql::builder::Insert;
let entity = User { id: 1, name: "Alice".to_string() };
let insert_query = Insert::one(&entity, &PRIMARY_KEY).unwrap();Aliased Type§
pub struct Insert<'a, ET> { /* private fields */ }