@@ -5,13 +5,21 @@ use std::error::Error;
55use crate :: query:: bounds:: { FieldIdentifier , FieldValueIdentifier , TableMetadata } ;
66use crate :: query:: operators:: Comp ;
77use crate :: query:: parameters:: QueryParameter ;
8+ use crate :: query:: querybuilder:: syntax:: column:: ColumnRef ;
89
910pub trait DeleteQueryBuilderOps < ' a > : QueryBuilderOps < ' a > { }
1011
1112pub trait UpdateQueryBuilderOps < ' a > : QueryBuilderOps < ' a > {
1213 /// Creates an SQL `SET` clause by specifying the columns that must be updated in the sentence,
13- /// but without adding any [`QueryParameter`] value to the internal querybuilder
14- fn set ( self , columns : & ' a [ String ] ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
14+ /// but without adding any [`QueryParameter`] value to the internal querybuilder.
15+ ///
16+ /// Is it the responsibility of the callee to pass the query values that will match the generated
17+ /// sql placeholders
18+ ///
19+ /// Note: If there's values already on the querybuilder, and the only placeholders api is called,
20+ /// UB (provisionally) will occur, since we're refactoring the API's and these are subject to change
21+ /// at any time while in the v0.x.x
22+ fn set < I : Into < ColumnRef < ' a > > > ( self , columns : Vec < I > ) -> Result < Self , Box < dyn Error + Send + Sync + ' a > >
1523 where Self : Sized ;
1624
1725 /// Similar to [`Self::set`] but storing the underlying update values for each column in the
@@ -26,7 +34,7 @@ pub trait UpdateQueryBuilderOps<'a>: QueryBuilderOps<'a> {
2634pub trait SelectQueryBuilderOps < ' a > : QueryBuilderOps < ' a > {
2735 /// Adds the column names that must be added to the query in order to retrieve the correct mapped fields
2836 /// If this method isn't invoked, the querybuilder will create a SELECT * FROM query
29- fn with_columns ( self , columns : & ' a [ String ] ) -> Self ;
37+ fn with_columns < I : Into < ColumnRef < ' a > > > ( self , columns : Vec < I > ) -> Self ;
3038
3139 /// Adds a *LEFT JOIN* SQL statement to the underlying
3240 /// `Sql Statement` held by the [`QueryBuilder`], where:
@@ -121,16 +129,16 @@ pub trait SelectQueryBuilderOps<'a>: QueryBuilderOps<'a> {
121129pub trait QueryBuilderOps < ' a > {
122130 /// Returns a read-only reference to the underlying SQL sentence,
123131 /// with the same lifetime as self
124- fn read_sql ( & ' a self ) -> & ' a str ;
125-
126- /// Public interface for append the content of a slice to the end of
127- /// the underlying SQL sentence.
128- ///
129- /// This mutator will allow the user to wire SQL code to the already
130- /// generated one
131- ///
132- /// * `sql` - The [`&str`] to be wired in the SQL
133- fn push_sql ( self , sql : & str ) ;
132+ // fn read_sql(&'a self) -> &'a str;
133+
134+ // // / Public interface for append the content of a slice to the end of
135+ // // / the underlying SQL sentence.
136+ // // /
137+ // // / This mutator will allow the user to wire SQL code to the already
138+ // // / generated one
139+ // // /
140+ // // / * `sql` - The [`&str`] to be wired in the SQL
141+ // fn push_sql(self, sql: &str);
134142
135143 /// Generates a `WHERE` SQL clause for constraint the query.
136144 ///
0 commit comments