Skip to content

Commit 17910f2

Browse files
committed
Bump version to 0.60.1 and add missing Spanned impls.
1 parent 4094fc8 commit 17910f2

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "pgmold-sqlparser"
2020
description = "Fork of sqlparser with additional PostgreSQL features (PARTITION OF, SECURITY DEFINER/INVOKER, SET params)"
21-
version = "0.60.0"
21+
version = "0.60.1"
2222
authors = ["Filipe Guerreiro <filipe.m.guerreiro@gmail.com>"]
2323
homepage = "https://github.com/fmguerreiro/datafusion-sqlparser-rs"
2424
documentation = "https://docs.rs/pgmold-sqlparser/"

src/ast/spans.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ use super::{
3434
ColumnOption, ColumnOptionDef, ConditionalStatementBlock, ConditionalStatements,
3535
ConflictTarget, ConnectBy, ConstraintCharacteristics, CopySource, CreateIndex, CreateTable,
3636
CreateTableOptions, Cte, Delete, DoUpdate, ExceptSelectItem, ExcludeSelectItem, Expr,
37-
ExprWithAlias, Fetch, FromTable, Function, FunctionArg, FunctionArgExpr,
37+
ExprWithAlias, Fetch, ForValues, FromTable, Function, FunctionArg, FunctionArgExpr,
3838
FunctionArgumentClause, FunctionArgumentList, FunctionArguments, GroupByExpr, HavingBound,
3939
IfStatement, IlikeSelectItem, IndexColumn, Insert, Interpolate, InterpolateExpr, Join,
4040
JoinConstraint, JoinOperator, JsonPath, JsonPathElem, LateralView, LimitClause,
4141
MatchRecognizePattern, Measure, Merge, MergeAction, MergeClause, MergeInsertExpr,
4242
MergeInsertKind, MergeUpdateExpr, NamedParenthesizedList, NamedWindowDefinition, ObjectName,
4343
ObjectNamePart, Offset, OnConflict, OnConflictAction, OnInsert, OpenStatement, OrderBy,
44-
OrderByExpr, OrderByKind, OutputClause, Partition, PivotValueSource, ProjectionSelect, Query,
44+
OrderByExpr, OrderByKind, OutputClause, Partition, PartitionBoundValue, PivotValueSource, ProjectionSelect, Query,
4545
RaiseStatement, RaiseStatementValue, ReferentialAction, RenameSelectItem, ReplaceSelectElement,
4646
ReplaceSelectItem, Select, SelectInto, SelectItem, SetExpr, SqlOption, Statement, Subscript,
4747
SymbolDefinition, TableAlias, TableAliasColumnDef, TableConstraint, TableFactor, TableObject,
@@ -592,6 +592,31 @@ impl Spanned for CreateTable {
592592
}
593593
}
594594

595+
impl Spanned for PartitionBoundValue {
596+
fn span(&self) -> Span {
597+
match self {
598+
PartitionBoundValue::Expr(expr) => expr.span(),
599+
PartitionBoundValue::MinValue => Span::empty(),
600+
PartitionBoundValue::MaxValue => Span::empty(),
601+
}
602+
}
603+
}
604+
605+
impl Spanned for ForValues {
606+
fn span(&self) -> Span {
607+
match self {
608+
ForValues::In(exprs) => union_spans(exprs.iter().map(|e| e.span())),
609+
ForValues::From { from, to } => union_spans(
610+
from.iter()
611+
.map(|v| v.span())
612+
.chain(to.iter().map(|v| v.span())),
613+
),
614+
ForValues::With { .. } => Span::empty(),
615+
ForValues::Default => Span::empty(),
616+
}
617+
}
618+
}
619+
595620
impl Spanned for ColumnDef {
596621
fn span(&self) -> Span {
597622
let ColumnDef {

0 commit comments

Comments
 (0)