callum-ryan commented on code in PR #534:
URL: https://github.com/apache/iceberg-rust/pull/534#discussion_r1740065220
##########
crates/catalog/sql/src/catalog.rs:
##########
@@ -141,21 +142,30 @@ impl SqlCatalog {
}
/// SQLX Any does not implement PostgresSQL bindings, so we have to do
this.
- pub async fn execute_statement(
- &self,
- query: &String,
- args: Vec<Option<&String>>,
- ) -> Result<Vec<AnyRow>> {
- let query_with_placeholders: Cow<str> =
- if self.sql_bind_style == SqlBindStyle::DollarNumeric {
- let mut query = query.clone();
- for i in 0..args.len() {
- query = query.replacen("?", &format!("${}", i + 1), 1);
- }
- Cow::Owned(query)
- } else {
- Cow::Borrowed(query)
- };
+ fn replace_placeholders(&self, query: &str) -> String {
+ match self.sql_bind_style {
Review Comment:
Ok - I've added some comments to the config to explain the parameter's
options. It might be worth a rethink when I do the Table functionality in this
coming week. Maybe as an Option that defaults to looking at the db type if not
provided.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]