xitep commented on code in PR #1979:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1979#discussion_r2241698474


##########
src/dialect/mod.rs:
##########
@@ -841,6 +841,12 @@ pub trait Dialect: Debug + Any {
         false
     }
 
+    /// Returns true if this dialect allow colon placeholders
+    /// e.g. `SELECT :var` (JPA named parameters)
+    fn supports_colon_placeholder(&self) -> bool {
+        false
+    }

Review Comment:
   ok, i can try it out and upgrade this PR accordingly. here's one thought to 
be clarified before i set off with it:
   
   ```rust
   Token::Placeholder {
        kind: PlaceholderKind,
        value: Option<String>
   }
   ```
   
   this implies to me that "value" would be stripped off of the placeholder 
demarcation character(s); e.g. for the input `":foo"` -> `value` would read 
`Some("foo")`, for the input `"$$foo$$"` it would read `Some("foo")`, for the 
input `"$"` `value` would be `None`, correct?
   
   But then, what would 
[`sqlparser::ast::Value::Placeholder(..)`](https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Value.html#variant.Placeholder)
 look like? Clients surely might want to know exactly which placeholder 
style/kind was used; since `sqlparser` supports various formats, some clients 
might opt in to reject what they don't want their queries to look like.
   
   all in all, it looks to me that in your proposal we want to end up with 
`value` being the original, full token as identified in the scanned input 
(which, naturally, is never `None` or empty), therefore:
   
   ```
   Token::Placeholder {
        kind: PlaceholderKind,
        value: String,  // ~ preferrably &'a str
   }
   ```
   
   any feedback on this thought?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to