pub type Update<'a, ET> = Update<'a, ET, Postgres, DataKind>;Expand description
Update builder type alias for PostgreSQL
PostgreSQL 的 Update 构建器类型别名
Used to build UPDATE statements for PostgreSQL databases. Provides methods to update records with flexible WHERE clauses and SET operations.
用于为 PostgreSQL 数据库构建 UPDATE 语句。提供使用灵活的 WHERE 子句和 SET 操作更新记录的方法。
§Type Parameters
ET- The entity type that this update builder operates onET- 此更新构建器操作的实体类型
§Public Methods
one- Create a single entity update operationtable- Create an Update instance with the default table namewith_table- Create an Update instance with a custom table namefrom_query- Create an Update instance from a queryfrom_query_with_table- Create an Update instance from a query with a custom table namecustom- Custom SET columns or other query statementsfilter- Add WHERE condition to the update statementreturning- Add RETURNING clause to the update statementfinish- Finish building, get the internal QueryBuilder
§公共方法
one- 创建单个实体更新操作table- 创建使用默认表名的 Update 实例with_table- 创建使用自定义表名的 Update 实例from_query- 从外部查询中创建 Update 实例from_query_with_table- 从外部查询中创建 Update 实例,可以自定义表名custom- 自定义 SET 列或其他查询语句filter- 向查询中添加过滤查询部分returning- 添加 RETURNING 子句到更新语句finish- 结束构建,获取内部的 QueryBuilder
§Examples
use kitx::postgres::builder::Update;
let entity = User { id: 1, name: "Bob".to_string() };
let update_query = Update::one(&entity, &PRIMARY_KEY, true).unwrap();Aliased Type§
pub struct Update<'a, ET> { /* private fields */ }