Remove PRIORITY clause from DEFINE FIELD statement

This commit is contained in:
Tobie Morgan Hitchcock 2022-04-07 08:38:47 +01:00
parent 2a0c8ddb4a
commit 285b83244c

View file

@ -6,7 +6,6 @@ use crate::err::Error;
use crate::sql::algorithm::{algorithm, Algorithm}; use crate::sql::algorithm::{algorithm, Algorithm};
use crate::sql::base::{base, Base}; use crate::sql::base::{base, Base};
use crate::sql::comment::shouldbespace; use crate::sql::comment::shouldbespace;
use crate::sql::common::take_u64;
use crate::sql::duration::{duration, Duration}; use crate::sql::duration::{duration, Duration};
use crate::sql::error::IResult; use crate::sql::error::IResult;
use crate::sql::ident::ident_raw; use crate::sql::ident::ident_raw;
@ -801,7 +800,6 @@ pub struct DefineFieldStatement {
pub kind: Option<Kind>, pub kind: Option<Kind>,
pub value: Option<Value>, pub value: Option<Value>,
pub assert: Option<Value>, pub assert: Option<Value>,
pub priority: Option<u64>,
pub permissions: Permissions, pub permissions: Permissions,
} }
@ -878,10 +876,6 @@ fn field(i: &str) -> IResult<&str, DefineFieldStatement> {
DefineFieldOption::Assert(ref v) => Some(v.to_owned()), DefineFieldOption::Assert(ref v) => Some(v.to_owned()),
_ => None, _ => None,
}), }),
priority: opts.iter().find_map(|x| match x {
DefineFieldOption::Priority(ref v) => Some(v.to_owned()),
_ => None,
}),
permissions: opts permissions: opts
.iter() .iter()
.find_map(|x| match x { .find_map(|x| match x {
@ -898,12 +892,11 @@ pub enum DefineFieldOption {
Kind(Kind), Kind(Kind),
Value(Value), Value(Value),
Assert(Value), Assert(Value),
Priority(u64),
Permissions(Permissions), Permissions(Permissions),
} }
fn field_opts(i: &str) -> IResult<&str, DefineFieldOption> { fn field_opts(i: &str) -> IResult<&str, DefineFieldOption> {
alt((field_kind, field_value, field_assert, field_priority, field_permissions))(i) alt((field_kind, field_value, field_assert, field_permissions))(i)
} }
fn field_kind(i: &str) -> IResult<&str, DefineFieldOption> { fn field_kind(i: &str) -> IResult<&str, DefineFieldOption> {
@ -930,14 +923,6 @@ fn field_assert(i: &str) -> IResult<&str, DefineFieldOption> {
Ok((i, DefineFieldOption::Assert(v))) Ok((i, DefineFieldOption::Assert(v)))
} }
fn field_priority(i: &str) -> IResult<&str, DefineFieldOption> {
let (i, _) = shouldbespace(i)?;
let (i, _) = tag_no_case("PRIORITY")(i)?;
let (i, _) = shouldbespace(i)?;
let (i, v) = take_u64(i)?;
Ok((i, DefineFieldOption::Priority(v)))
}
fn field_permissions(i: &str) -> IResult<&str, DefineFieldOption> { fn field_permissions(i: &str) -> IResult<&str, DefineFieldOption> {
let (i, _) = shouldbespace(i)?; let (i, _) = shouldbespace(i)?;
let (i, v) = permissions(i)?; let (i, v) = permissions(i)?;