Skip to content

Commit db7911b

Browse files
committed
Add migration guide
1 parent f344a3c commit db7911b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

changelog/0.55.0.md

+21
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ under the License.
2121

2222
This release consists of 55 commits from 25 contributors. See credits at the end of this changelog for more information.
2323

24+
## Migrating usages of `Expr::Value`
25+
26+
In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate.
27+
28+
### When pattern matching
29+
30+
```diff
31+
- Expr::Value(Value::SingleQuotedString(my_string)) => { ... }
32+
+ Expr::Value(ValueWithSpan{ value: Value::SingleQuotedString(my_string), span: _ }) => { ... }
33+
```
34+
35+
### When creating an `Expr`
36+
37+
Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span :
38+
39+
```diff
40+
- Expr::Value(Value::SingleQuotedString(my_string))
41+
+ Expr::value(Value::SingleQuotedString(my_string))
42+
```
43+
44+
2445
**Breaking changes:**
2546

2647
- Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma)

0 commit comments

Comments
 (0)