11//! Contains the elements that makes part of the formal declaration
22//! of the behaviour of the Canyon-SQL QueryBuilder
33
4- use std:: error:: Error ;
54use crate :: query:: bounds:: { FieldIdentifier , FieldValueIdentifier } ;
65use crate :: query:: operators:: Comp ;
76use crate :: query:: parameters:: QueryParameter ;
87use crate :: query:: querybuilder:: syntax:: column:: ColumnRef ;
98use crate :: query:: querybuilder:: syntax:: table_metadata:: TableMetadata ;
9+ use std:: error:: Error ;
1010
1111pub trait DeleteQueryBuilderOps < ' a > : QueryBuilderOps < ' a > { }
1212
1313pub trait UpdateQueryBuilderOps < ' a > : QueryBuilderOps < ' a > {
1414 /// Creates an SQL `SET` clause by specifying the columns that must be updated in the sentence,
1515 /// but without adding any [`QueryParameter`] value to the internal querybuilder.
16- ///
16+ ///
1717 /// Is it the responsibility of the callee to pass the query values that will match the generated
1818 /// sql placeholders
19- ///
19+ ///
2020 /// Note: If there's values already on the querybuilder, and the only placeholders api is called,
2121 /// UB (provisionally) will occur, since we're refactoring the API's and these are subject to change
2222 /// at any time while in the v0.x.x
23- fn set < I : Into < ColumnRef < ' a > > > ( self , columns : Vec < I > ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
24- where Self : Sized ;
23+ fn set < I : Into < ColumnRef < ' a > > > (
24+ self ,
25+ columns : Vec < I > ,
26+ ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
27+ where
28+ Self : Sized ;
2529
2630 /// Similar to [`Self::set`] but storing the underlying update values for each column in the
2731 /// internal values collection of the [`crate::query::querybuilder::QueryBuilder`]
28- fn set_values < Z , Q > ( self , columns : & ' a [ ( Z , Q ) ] ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
32+ fn set_values < Z , Q > (
33+ self ,
34+ columns : & ' a [ ( Z , Q ) ] ,
35+ ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
2936 where
3037 Z : FieldIdentifier ,
3138 Q : QueryParameter ,
@@ -36,7 +43,7 @@ pub trait SelectQueryBuilderOps<'a>: QueryBuilderOps<'a> {
3643 /// Adds the column names that must be added to the query in order to retrieve the correct mapped fields
3744 /// If this method isn't invoked, the querybuilder will create a SELECT * FROM query
3845 fn with_columns < I : Into < ColumnRef < ' a > > > ( self , columns : Vec < I > ) -> Self ;
39-
46+
4047 /// Adds a *LEFT JOIN* SQL statement to the underlying
4148 /// `Sql Statement` held by the [`QueryBuilder`], where:
4249 ///
@@ -181,7 +188,11 @@ pub trait QueryBuilderOps<'a> {
181188 /// the field name that maps the targeted column name
182189 /// * `values` - An array of [`QueryParameter`] with the values to filter
183190 /// inside the `IN` operator
184- fn and_values_in < ' b , Z , Q > ( self , column : Z , values : & ' a [ Q ] ) -> Result < Self , Box < dyn Error + Send + Sync + ' b > >
191+ fn and_values_in < ' b , Z , Q > (
192+ self ,
193+ column : Z ,
194+ values : & ' a [ Q ] ,
195+ ) -> Result < Self , Box < dyn Error + Send + Sync + ' b > >
185196 where
186197 Z : FieldIdentifier ,
187198 Q : QueryParameter ,
@@ -195,7 +206,11 @@ pub trait QueryBuilderOps<'a> {
195206 /// the field name that maps the targeted column name
196207 /// * `values` - An array of [`QueryParameter`] with the values to filter
197208 /// inside the `IN` operator
198- fn or_values_in < ' b , Z , Q > ( self , r#or : Z , values : & ' a [ Q ] ) -> Result < Self , Box < dyn Error + Send + Sync + ' b > >
209+ fn or_values_in < ' b , Z , Q > (
210+ self ,
211+ r#or : Z ,
212+ values : & ' a [ Q ] ,
213+ ) -> Result < Self , Box < dyn Error + Send + Sync + ' b > >
199214 where
200215 Z : FieldIdentifier ,
201216 Q : QueryParameter ,
0 commit comments