cargo fmt
This commit is contained in:
parent
088bfd01e7
commit
b716c9ed57
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert, PrimaryKeyTrait,
|
error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert,
|
||||||
Statement, TryFromU64,
|
PrimaryKeyTrait, Statement, TryFromU64,
|
||||||
};
|
};
|
||||||
use sea_query::InsertStatement;
|
use sea_query::InsertStatement;
|
||||||
use std::{future::Future, marker::PhantomData};
|
use std::{future::Future, marker::PhantomData};
|
||||||
|
@ -276,7 +276,9 @@ pub trait QueryFilter: Sized {
|
|||||||
/// struct Input {
|
/// struct Input {
|
||||||
/// name: Option<String>,
|
/// name: Option<String>,
|
||||||
/// }
|
/// }
|
||||||
/// let input = Input { name: Some("cheese".to_owned()) };
|
/// let input = Input {
|
||||||
|
/// name: Some("cheese".to_owned()),
|
||||||
|
/// };
|
||||||
///
|
///
|
||||||
/// let mut conditions = Condition::all();
|
/// let mut conditions = Condition::all();
|
||||||
/// if let Some(name) = input.name {
|
/// if let Some(name) = input.name {
|
||||||
@ -298,13 +300,14 @@ pub trait QueryFilter: Sized {
|
|||||||
/// struct Input {
|
/// struct Input {
|
||||||
/// name: Option<String>,
|
/// name: Option<String>,
|
||||||
/// }
|
/// }
|
||||||
/// let input = Input { name: Some("cheese".to_owned()) };
|
/// let input = Input {
|
||||||
|
/// name: Some("cheese".to_owned()),
|
||||||
|
/// };
|
||||||
///
|
///
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// cake::Entity::find()
|
/// cake::Entity::find()
|
||||||
/// .filter(
|
/// .filter(
|
||||||
/// Condition::all()
|
/// Condition::all().add_option(input.name.map(|n| cake::Column::Name.contains(&n)))
|
||||||
/// .add_option(input.name.map(|n| cake::Column::Name.contains(&n)))
|
|
||||||
/// )
|
/// )
|
||||||
/// .build(DbBackend::MySql)
|
/// .build(DbBackend::MySql)
|
||||||
/// .to_string(),
|
/// .to_string(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user