From 640c0b0b1262ac3f5a0eda1fae8c9faf5a6d92f5 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 9 May 2022 23:24:42 +0100 Subject: [PATCH] Allow for alternative phrasing in DEFINE FIELD clause --- lib/src/sql/statements/define.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/sql/statements/define.rs b/lib/src/sql/statements/define.rs index 3aada534..13f9ddd7 100644 --- a/lib/src/sql/statements/define.rs +++ b/lib/src/sql/statements/define.rs @@ -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| {