Skip to content

Commit 15f99a6

Browse files
committed
Add notes about ObjectName
1 parent db7911b commit 15f99a6

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

changelog/0.55.0.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This release consists of 55 commits from 25 contributors. See credits at the end
2323

2424
## Migrating usages of `Expr::Value`
2525

26-
In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate.
26+
In v0.55 of sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate.
2727

2828
### When pattern matching
2929

@@ -34,13 +34,41 @@ In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` in
3434

3535
### When creating an `Expr`
3636

37-
Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span :
37+
Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span:
3838

3939
```diff
4040
- Expr::Value(Value::SingleQuotedString(my_string))
4141
+ Expr::value(Value::SingleQuotedString(my_string))
4242
```
4343

44+
## Migrating usages of `ObjectName`
45+
46+
In v0.55 of sqlparser, the `ObjectName` structure has been changed as shown below. Here is now to migrate.
47+
48+
```diff
49+
- pub struct ObjectName(pub Vec<Ident>);
50+
+ pub struct ObjectName(pub Vec<ObjectNamePart>)
51+
```
52+
53+
### When constructing `ObjectName`
54+
55+
Use the `From` impl:
56+
57+
```diff
58+
- name: ObjectName(vec![Ident::new("f")]),
59+
+ name: ObjectName::from(vec![Ident::new("f")]),
60+
```
61+
62+
### Accessing Spans
63+
64+
Use the `span()` function
65+
66+
```diff
67+
- name.span
68+
+ name.span()
69+
```
70+
71+
4472

4573
**Breaking changes:**
4674

0 commit comments

Comments
 (0)