graup commented on code in PR #1679:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1679#discussion_r1928954728
##########
src/ast/value.rs:
##########
@@ -97,6 +97,32 @@ pub enum Value {
Placeholder(String),
}
+impl Into<String> for Value {
+ fn into(self) -> String {
+ match self {
+ Value::SingleQuotedString(s) => s,
+ Value::TripleSingleQuotedString(s) => s,
+ Value::TripleDoubleQuotedString(s) => s,
+ Value::EscapedStringLiteral(s) => s,
+ Value::UnicodeStringLiteral(s) => s,
+ Value::SingleQuotedByteStringLiteral(s) => s,
+ Value::DoubleQuotedByteStringLiteral(s) => s,
+ Value::TripleSingleQuotedByteStringLiteral(s) => s,
+ Value::TripleDoubleQuotedByteStringLiteral(s) => s,
+ Value::SingleQuotedRawStringLiteral(s) => s,
+ Value::DoubleQuotedRawStringLiteral(s) => s,
+ Value::TripleSingleQuotedRawStringLiteral(s) => s,
+ Value::TripleDoubleQuotedRawStringLiteral(s) => s,
+ Value::NationalStringLiteral(s) => s,
+ Value::HexStringLiteral(s) => s,
+ Value::DoubleQuotedString(s) => s,
+ Value::Placeholder(s) => s,
+ Value::DollarQuotedString(s) => s.value,
+ _ => panic!("not a string value"),
Review Comment:
Strictly speaking no, but without it, users that used the string value
before have to put code like this in their code. Thought it would be nice
offering a more easy migration by just adding `.into()` to the existing usage.
--
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]