use super::clause::ClauseCursor;
use crate::error::SqlError;
pub(super) fn if_exists_name(
c: &mut ClauseCursor<'_, '_>,
what: &str,
) -> Result<(bool, String), SqlError> {
let if_exists = c.eat_keywords(&["IF", "EXISTS"]);
let name = c.ident(what)?;
Ok((if_exists, name))
}
pub(super) fn if_not_exists_name(
c: &mut ClauseCursor<'_, '_>,
what: &str,
) -> Result<(bool, String), SqlError> {
let if_not_exists = c.eat_keywords(&["IF", "NOT", "EXISTS"]);
let name = c.ident(what)?;
Ok((if_not_exists, name))
}