diff --git a/sea-query-binder/src/sqlx_any.rs b/sea-query-binder/src/sqlx_any.rs index 8f303eefb..1f6019241 100644 --- a/sea-query-binder/src/sqlx_any.rs +++ b/sea-query-binder/src/sqlx_any.rs @@ -107,15 +107,15 @@ impl<'q> sqlx::IntoArguments<'q, sqlx::any::Any> for SqlxValues { } #[cfg(feature = "with-ipnetwork")] Value::IpNetwork(_) => { - panic!("SeaQuery doesn't support IpNetwork arguments for Any"); + panic!("SQLx doesn't support IpNetwork arguments for Any"); } #[cfg(feature = "with-mac_address")] Value::MacAddress(_) => { - panic!("SeaQuery doesn't support MacAddress arguments for Any"); + panic!("SQLx doesn't support MacAddress arguments for Any"); } #[cfg(feature = "postgres-array")] Value::Array(_, _) => { - panic!("SeaQuery doesn't support array arguments for Any"); + panic!("SQLx doesn't support array arguments for Any"); } } } diff --git a/src/query/with.rs b/src/query/with.rs index 89ea69164..85815df24 100644 --- a/src/query/with.rs +++ b/src/query/with.rs @@ -1,15 +1,9 @@ -use crate::ColumnRef; -use crate::DynIden; -use crate::IntoIden; -use crate::QueryStatementBuilder; -use crate::QueryStatementWriter; -use crate::SelectExpr; -use crate::SelectStatement; -use crate::SimpleExpr; -use crate::SqlWriter; -use crate::SubQueryStatement; -use crate::TableRef; -use crate::{Alias, QueryBuilder}; +use crate::{ + ColumnRef, DynIden, IntoIden, QueryStatementBuilder, QueryStatementWriter, SelectExpr, + SelectStatement, SimpleExpr, SqlWriter, SubQueryStatement, TableRef, Values, + {Alias, QueryBuilder}, +}; +use inherent::inherent; /// A table definition inside a WITH clause ([WithClause]). /// @@ -594,8 +588,17 @@ impl QueryStatementBuilder for WithQuery { } } +#[inherent] impl QueryStatementWriter for WithQuery { - fn build_collect_into(&self, query_builder: T, sql: &mut dyn SqlWriter) { + pub fn build_collect_into(&self, query_builder: T, sql: &mut dyn SqlWriter) { query_builder.prepare_with_query(self, sql); } + + pub fn build_collect( + &self, + query_builder: T, + sql: &mut dyn SqlWriter, + ) -> String; + pub fn build(&self, query_builder: T) -> (String, Values); + pub fn to_string(&self, query_builder: T) -> String; }