Allow for alternative phrasing in DEFINE FIELD clause

This commit is contained in:
Tobie Morgan Hitchcock 2022-05-09 23:24:42 +01:00
parent 43d361646c
commit 640c0b0b12

View file

@ -979,7 +979,7 @@ impl DefineIndexStatement {
impl fmt::Display for DefineIndexStatement {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "DEFINE INDEX {} ON {} COLUMNS {}", self.name, self.what, self.cols)?;
write!(f, "DEFINE INDEX {} ON {} FIELDS {}", self.name, self.what, self.cols)?;
if self.uniq {
write!(f, " UNIQUE")?
}
@ -999,7 +999,7 @@ fn index(i: &str) -> IResult<&str, DefineIndexStatement> {
let (i, _) = shouldbespace(i)?;
let (i, what) = ident_raw(i)?;
let (i, _) = shouldbespace(i)?;
let (i, _) = tag_no_case("COLUMNS")(i)?;
let (i, _) = alt((tag_no_case("COLUMNS"), tag_no_case("FIELDS")))(i)?;
let (i, _) = shouldbespace(i)?;
let (i, cols) = idiom::locals(i)?;
let (i, uniq) = opt(|i| {