#![allow(dead_code)]
#![allow(clippy::all)]
use crate::ast::*;
pub(crate) struct RenderShapeFingerprint<const VALUE: u64>;
pub(crate) const CURRENT_RENDER_SHAPE_DCL: RenderShapeFingerprint<0x0bc66b9b4759b4e4> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_DDL: RenderShapeFingerprint<0xb7fb9938befad896> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_DML: RenderShapeFingerprint<0x5bdcbbc8cc864aec> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_EXPR: RenderShapeFingerprint<0xde8cec2513ed42e5> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_EXT: RenderShapeFingerprint<0xffd1225e92e4dab2> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_IDENT: RenderShapeFingerprint<0xbc5427055a4e813c> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_LITERAL: RenderShapeFingerprint<0x509ea17dec9af986> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_MATCH_RECOGNIZE: RenderShapeFingerprint<0x8b1ed704455adf27> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_PIPE_OPS: RenderShapeFingerprint<0x5ebfaa9fb0c1caf9> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_PIVOT: RenderShapeFingerprint<0xd3444362d3f03fe8> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_QUERY: RenderShapeFingerprint<0xe6cc8d2df67c101c> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_REPLICATION: RenderShapeFingerprint<0xfa8b2915218d27ba> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_STMT: RenderShapeFingerprint<0x957db431c4a1db51> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_STORED_PROGRAM: RenderShapeFingerprint<0xfb50d22f049b4cc7> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_TCL: RenderShapeFingerprint<0x1a58662f47080916> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_TY: RenderShapeFingerprint<0x03efd7c0644eb26a> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_UTIL: RenderShapeFingerprint<0x30c6b7a3fb94d049> =
RenderShapeFingerprint;
pub(crate) const CURRENT_RENDER_SHAPE_WINDOW: RenderShapeFingerprint<0x585b3bd313272236> =
RenderShapeFingerprint;
pub(crate) fn render_shape_session_statement<X: Extension>(node: &SessionStatement<X>) {
match node {
SessionStatement::Set {
scope,
name,
assignment,
value,
meta,
} => {
if let Some(item) = scope.as_ref() {
render_shape_set_scope(item);
}
render_shape_object_name(name);
render_shape_set_assignment(assignment);
render_shape_set_value(value);
touch(meta);
}
SessionStatement::SetTimeZone { scope, value, meta } => {
if let Some(item) = scope.as_ref() {
render_shape_set_scope(item);
}
render_shape_special_set_value(value);
touch(meta);
}
SessionStatement::SetRole { scope, role, meta } => {
if let Some(item) = scope.as_ref() {
render_shape_set_scope(item);
}
render_shape_special_set_value(role);
touch(meta);
}
SessionStatement::SetSessionAuthorization { scope, user, meta } => {
if let Some(item) = scope.as_ref() {
render_shape_set_scope(item);
}
render_shape_special_set_value(user);
touch(meta);
}
SessionStatement::SetConstraints {
constraints,
check_time,
meta,
} => {
render_shape_constraints_target(constraints);
render_shape_constraint_check_time(check_time);
touch(meta);
}
SessionStatement::SetNames { value, meta } => {
render_shape_set_names_value(value);
touch(meta);
}
SessionStatement::SetSessionCharacteristics { modes, meta } => {
for item in modes.iter() {
render_shape_transaction_mode(item);
}
touch(meta);
}
SessionStatement::Reset {
scope,
target,
meta,
} => {
if let Some(item) = scope.as_ref() {
render_shape_set_scope(item);
}
render_shape_config_parameter(target);
touch(meta);
}
SessionStatement::Show {
target,
verbose,
meta,
} => {
render_shape_config_parameter(target);
touch(verbose);
touch(meta);
}
SessionStatement::SetVariables { assignments, meta } => {
for item in assignments.iter() {
render_shape_set_variable_assignment(item);
}
touch(meta);
}
SessionStatement::SetCharacterSet {
keyword,
value,
meta,
} => {
render_shape_character_set_keyword(keyword);
render_shape_set_character_set_value(value);
touch(meta);
}
SessionStatement::SetResourceGroup {
name,
thread_ids,
meta,
} => {
render_shape_ident(name);
if let Some(item) = thread_ids.as_ref() {
for item1 in item.iter() {
render_shape_literal(item1);
}
}
touch(meta);
}
}
}
pub(crate) fn render_shape_set_variable_assignment<X: Extension>(node: &SetVariableAssignment<X>) {
match node {
SetVariableAssignment::SystemVariable {
scope,
name,
assignment,
value,
meta,
} => {
render_shape_system_variable_scope(scope);
render_shape_object_name(name);
render_shape_set_assignment(assignment);
render_shape_set_variable_value(value);
touch(meta);
}
SetVariableAssignment::UserVariable {
name,
assignment,
value,
meta,
} => {
render_shape_ident(name);
render_shape_set_assignment(assignment);
render_shape_expr(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_system_variable_scope(node: &SystemVariableScope) {
match node {
SystemVariableScope::Implicit => {}
SystemVariableScope::Keyword(field0) => {
render_shape_system_variable_scope_kind(field0);
}
SystemVariableScope::AtAt => {}
SystemVariableScope::AtAtScoped(field0) => {
render_shape_system_variable_scope_kind(field0);
}
}
}
pub(crate) fn render_shape_system_variable_scope_kind(node: &SystemVariableScopeKind) {
match node {
SystemVariableScopeKind::Global => {}
SystemVariableScopeKind::Session => {}
SystemVariableScopeKind::Local => {}
SystemVariableScopeKind::Persist => {}
SystemVariableScopeKind::PersistOnly => {}
}
}
pub(crate) fn render_shape_set_variable_value<X: Extension>(node: &SetVariableValue<X>) {
match node {
SetVariableValue::Default { meta } => {
touch(meta);
}
SetVariableValue::Keyword { keyword, meta } => {
render_shape_set_variable_keyword(keyword);
touch(meta);
}
SetVariableValue::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
}
}
pub(crate) fn render_shape_set_variable_keyword(node: &SetVariableKeyword) {
match node {
SetVariableKeyword::On => {}
SetVariableKeyword::All => {}
SetVariableKeyword::Binary => {}
SetVariableKeyword::Row => {}
SetVariableKeyword::System => {}
}
}
pub(crate) fn render_shape_character_set_keyword(node: &CharacterSetKeyword) {
match node {
CharacterSetKeyword::CharacterSet => {}
CharacterSetKeyword::Charset => {}
}
}
pub(crate) fn render_shape_set_character_set_value(node: &SetCharacterSetValue) {
match node {
SetCharacterSetValue::Default { meta } => {
touch(meta);
}
SetCharacterSetValue::Charset { charset, meta } => {
render_shape_set_parameter_value(charset);
touch(meta);
}
}
}
pub(crate) fn render_shape_set_scope(node: &SetScope) {
match node {
SetScope::Session => {}
SetScope::Local => {}
SetScope::Global => {}
}
}
pub(crate) fn render_shape_set_assignment(node: &SetAssignment) {
match node {
SetAssignment::To => {}
SetAssignment::Equals => {}
SetAssignment::ColonEquals => {}
}
}
pub(crate) fn render_shape_set_value(node: &SetValue) {
match node {
SetValue::Default { meta } => {
touch(meta);
}
SetValue::Values { values, meta } => {
for item in values.iter() {
render_shape_set_parameter_value(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_set_parameter_value(node: &SetParameterValue) {
match node {
SetParameterValue::Literal { literal, meta } => {
render_shape_literal(literal);
touch(meta);
}
SetParameterValue::Name { name, meta } => {
render_shape_ident(name);
touch(meta);
}
SetParameterValue::Parameter { kind, meta } => {
render_shape_parameter_kind(kind);
touch(meta);
}
SetParameterValue::List { values, meta } => {
for item in values.iter() {
render_shape_set_parameter_value(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_special_set_value(node: &SpecialSetValue) {
match node {
SpecialSetValue::Default { meta } => {
touch(meta);
}
SpecialSetValue::Local { meta } => {
touch(meta);
}
SpecialSetValue::None { meta } => {
touch(meta);
}
SpecialSetValue::Value { value, meta } => {
render_shape_set_parameter_value(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_constraints_target(node: &ConstraintsTarget) {
match node {
ConstraintsTarget::All { meta } => {
touch(meta);
}
ConstraintsTarget::Names { names, meta } => {
for item in names.iter() {
render_shape_object_name(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_constraint_check_time(node: &ConstraintCheckTime) {
match node {
ConstraintCheckTime::Deferred => {}
ConstraintCheckTime::Immediate => {}
}
}
pub(crate) fn render_shape_set_names_value(node: &SetNamesValue) {
match node {
SetNamesValue::Default { meta } => {
touch(meta);
}
SetNamesValue::Charset {
charset,
collation,
meta,
} => {
render_shape_set_parameter_value(charset);
if let Some(item) = collation.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_config_parameter(node: &ConfigParameter) {
match node {
ConfigParameter::All { meta } => {
touch(meta);
}
ConfigParameter::Named { name, meta } => {
render_shape_object_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_system(node: &AlterSystem) {
let AlterSystem { action, meta } = node;
render_shape_alter_system_action(action);
touch(meta);
}
pub(crate) fn render_shape_alter_system_action(node: &AlterSystemAction) {
match node {
AlterSystemAction::Set {
name,
assignment,
value,
meta,
} => {
render_shape_object_name(name);
render_shape_set_assignment(assignment);
render_shape_set_value(value);
touch(meta);
}
AlterSystemAction::Reset { target, meta } => {
render_shape_config_parameter(target);
touch(meta);
}
}
}
pub(crate) fn render_shape_access_control_statement<X: Extension>(
node: &AccessControlStatement<X>,
) {
match node {
AccessControlStatement::AlterRoleRename {
name,
new_name,
meta,
} => {
render_shape_ident(name);
render_shape_ident(new_name);
touch(meta);
}
AccessControlStatement::Grant {
privileges,
object,
grantees,
with_grant_option,
granted_by,
meta,
} => {
render_shape_privileges(privileges);
render_shape_grant_object(object);
for item in grantees.iter() {
render_shape_grantee(item);
}
touch(with_grant_option);
if let Some(item) = granted_by.as_ref() {
render_shape_role_spec(item);
}
touch(meta);
}
AccessControlStatement::Revoke {
grant_option_for,
privileges,
object,
grantees,
granted_by,
behavior,
meta,
} => {
touch(grant_option_for);
render_shape_privileges(privileges);
render_shape_grant_object(object);
for item in grantees.iter() {
render_shape_grantee(item);
}
if let Some(item) = granted_by.as_ref() {
render_shape_role_spec(item);
}
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
AccessControlStatement::GrantRole {
roles,
grantees,
with_admin_option,
granted_by,
meta,
} => {
for item in roles.iter() {
render_shape_ident(item);
}
for item in grantees.iter() {
render_shape_grantee(item);
}
touch(with_admin_option);
if let Some(item) = granted_by.as_ref() {
render_shape_role_spec(item);
}
touch(meta);
}
AccessControlStatement::RevokeRole {
admin_option_for,
roles,
grantees,
granted_by,
behavior,
meta,
} => {
touch(admin_option_for);
for item in roles.iter() {
render_shape_ident(item);
}
for item in grantees.iter() {
render_shape_grantee(item);
}
if let Some(item) = granted_by.as_ref() {
render_shape_role_spec(item);
}
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
AccessControlStatement::AccountGrantPrivilege {
privileges,
object,
grantees,
with_grant_option,
grant_as,
meta,
} => {
render_shape_privileges(privileges);
render_shape_privilege_level_object(object);
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(with_grant_option);
if let Some(item) = grant_as.as_ref() {
render_shape_grant_as(item);
}
touch(meta);
}
AccessControlStatement::AccountGrantProxy {
proxy,
grantees,
with_grant_option,
meta,
} => {
render_shape_account_name(proxy);
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(with_grant_option);
touch(meta);
}
AccessControlStatement::AccountGrantRole {
roles,
grantees,
with_admin_option,
meta,
} => {
for item in roles.iter() {
render_shape_account_name(item);
}
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(with_admin_option);
touch(meta);
}
AccessControlStatement::AccountRevokePrivilege {
if_exists,
privileges,
object,
grantees,
ignore_unknown_user,
meta,
} => {
touch(if_exists);
render_shape_privileges(privileges);
render_shape_privilege_level_object(object);
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(ignore_unknown_user);
touch(meta);
}
AccessControlStatement::AccountRevokeAll {
if_exists,
privileges_keyword,
grantees,
ignore_unknown_user,
meta,
} => {
touch(if_exists);
touch(privileges_keyword);
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(ignore_unknown_user);
touch(meta);
}
AccessControlStatement::AccountRevokeProxy {
if_exists,
proxy,
grantees,
ignore_unknown_user,
meta,
} => {
touch(if_exists);
render_shape_account_name(proxy);
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(ignore_unknown_user);
touch(meta);
}
AccessControlStatement::AccountRevokeRole {
if_exists,
roles,
grantees,
ignore_unknown_user,
meta,
} => {
touch(if_exists);
for item in roles.iter() {
render_shape_account_name(item);
}
for item in grantees.iter() {
render_shape_account_name(item);
}
touch(ignore_unknown_user);
touch(meta);
}
}
}
pub(crate) fn render_shape_privilege_level_object(node: &PrivilegeLevelObject) {
let PrivilegeLevelObject {
object_type,
level,
meta,
} = node;
render_shape_privilege_object_type(object_type);
render_shape_privilege_level(level);
touch(meta);
}
pub(crate) fn render_shape_privilege_object_type(node: &PrivilegeObjectType) {
match node {
PrivilegeObjectType::Table { explicit } => {
touch(explicit);
}
PrivilegeObjectType::Function => {}
PrivilegeObjectType::Procedure => {}
}
}
pub(crate) fn render_shape_privilege_level(node: &PrivilegeLevel) {
match node {
PrivilegeLevel::Global { meta } => {
touch(meta);
}
PrivilegeLevel::CurrentDatabase { meta } => {
touch(meta);
}
PrivilegeLevel::Database { database, meta } => {
render_shape_ident(database);
touch(meta);
}
PrivilegeLevel::Object { name, meta } => {
render_shape_object_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_grant_as(node: &GrantAs) {
let GrantAs {
user,
with_role,
meta,
} = node;
render_shape_account_name(user);
if let Some(item) = with_role.as_ref() {
render_shape_with_role_spec(item);
}
touch(meta);
}
pub(crate) fn render_shape_with_role_spec(node: &WithRoleSpec) {
match node {
WithRoleSpec::Roles { roles, meta } => {
for item in roles.iter() {
render_shape_account_name(item);
}
touch(meta);
}
WithRoleSpec::All { except, meta } => {
for item in except.iter() {
render_shape_account_name(item);
}
touch(meta);
}
WithRoleSpec::None { meta } => {
touch(meta);
}
WithRoleSpec::Default { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_privileges(node: &Privileges) {
match node {
Privileges::All {
privileges_keyword,
meta,
} => {
touch(privileges_keyword);
touch(meta);
}
Privileges::List { privileges, meta } => {
for item in privileges.iter() {
render_shape_privilege(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_privilege(node: &Privilege) {
match node {
Privilege::Known {
kind,
columns,
meta,
} => {
render_shape_privilege_kind(kind);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
Privilege::Other {
name,
columns,
meta,
} => {
render_shape_ident(name);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_privilege_kind(node: &PrivilegeKind) {
match node {
PrivilegeKind::Select => {}
PrivilegeKind::Insert => {}
PrivilegeKind::Update => {}
PrivilegeKind::Delete => {}
PrivilegeKind::Truncate => {}
PrivilegeKind::References => {}
PrivilegeKind::Trigger => {}
PrivilegeKind::Usage => {}
PrivilegeKind::Execute => {}
PrivilegeKind::Create => {}
PrivilegeKind::Connect => {}
PrivilegeKind::Temporary => {}
PrivilegeKind::Temp => {}
PrivilegeKind::Maintain => {}
PrivilegeKind::Index => {}
PrivilegeKind::Alter => {}
PrivilegeKind::Drop => {}
PrivilegeKind::Reload => {}
PrivilegeKind::Shutdown => {}
PrivilegeKind::Process => {}
PrivilegeKind::File => {}
PrivilegeKind::Super => {}
PrivilegeKind::Event => {}
PrivilegeKind::GrantOption => {}
PrivilegeKind::ShowDatabases => {}
PrivilegeKind::CreateTemporaryTables => {}
PrivilegeKind::LockTables => {}
PrivilegeKind::ReplicationSlave => {}
PrivilegeKind::ReplicationClient => {}
PrivilegeKind::CreateView => {}
PrivilegeKind::ShowView => {}
PrivilegeKind::CreateRoutine => {}
PrivilegeKind::AlterRoutine => {}
PrivilegeKind::CreateUser => {}
PrivilegeKind::CreateTablespace => {}
PrivilegeKind::CreateRole => {}
PrivilegeKind::DropRole => {}
}
}
pub(crate) fn render_shape_grant_object<X: Extension>(node: &GrantObject<X>) {
match node {
GrantObject::Table {
explicit,
names,
meta,
} => {
touch(explicit);
for item in names.iter() {
render_shape_object_name(item);
}
touch(meta);
}
GrantObject::Named { kind, names, meta } => {
render_shape_named_object_kind(kind);
for item in names.iter() {
render_shape_object_name(item);
}
touch(meta);
}
GrantObject::Routines {
kind,
routines,
meta,
} => {
render_shape_routine_object_kind(kind);
for item in routines.iter() {
render_shape_routine_signature(item);
}
touch(meta);
}
GrantObject::AllInSchema {
kind,
schemas,
meta,
} => {
render_shape_schema_object_kind(kind);
for item in schemas.iter() {
render_shape_object_name(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_named_object_kind(node: &NamedObjectKind) {
match node {
NamedObjectKind::Sequence => {}
NamedObjectKind::Database => {}
NamedObjectKind::Schema => {}
NamedObjectKind::Domain => {}
NamedObjectKind::Type => {}
NamedObjectKind::Language => {}
NamedObjectKind::Tablespace => {}
NamedObjectKind::ForeignDataWrapper => {}
NamedObjectKind::ForeignServer => {}
}
}
pub(crate) fn render_shape_routine_object_kind(node: &RoutineObjectKind) {
match node {
RoutineObjectKind::Function => {}
RoutineObjectKind::Procedure => {}
RoutineObjectKind::Routine => {}
}
}
pub(crate) fn render_shape_schema_object_kind(node: &SchemaObjectKind) {
match node {
SchemaObjectKind::Tables => {}
SchemaObjectKind::Sequences => {}
SchemaObjectKind::Functions => {}
SchemaObjectKind::Procedures => {}
SchemaObjectKind::Routines => {}
}
}
pub(crate) fn render_shape_routine_signature<X: Extension>(node: &RoutineSignature<X>) {
let RoutineSignature {
name,
arg_types,
meta,
} = node;
render_shape_object_name(name);
if let Some(item) = arg_types.as_ref() {
for item1 in item.iter() {
render_shape_data_type(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_grantee(node: &Grantee) {
let Grantee { group, spec, meta } = node;
touch(group);
render_shape_role_spec(spec);
touch(meta);
}
pub(crate) fn render_shape_role_spec(node: &RoleSpec) {
match node {
RoleSpec::Public { meta } => {
touch(meta);
}
RoleSpec::CurrentRole { meta } => {
touch(meta);
}
RoleSpec::CurrentUser { meta } => {
touch(meta);
}
RoleSpec::SessionUser { meta } => {
touch(meta);
}
RoleSpec::Name { name, meta } => {
render_shape_ident(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_user(node: &CreateUser) {
let CreateUser {
if_not_exists,
users,
default_roles,
require,
resource_options,
password_lock_options,
attribute,
meta,
} = node;
touch(if_not_exists);
for item in users.iter() {
render_shape_user_spec(item);
}
for item in default_roles.iter() {
render_shape_account_name(item);
}
if let Some(item) = require.as_ref() {
render_shape_tls_requirement(item);
}
for item in resource_options.iter() {
render_shape_resource_limit(item);
}
for item in password_lock_options.iter() {
render_shape_password_lock_option(item);
}
if let Some(item) = attribute.as_ref() {
render_shape_user_attribute(item);
}
touch(meta);
}
pub(crate) fn render_shape_user_spec(node: &UserSpec) {
let UserSpec {
account,
auth,
meta,
} = node;
render_shape_account_name(account);
if let Some(item) = auth.as_ref() {
render_shape_auth_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_auth_option(node: &AuthOption) {
match node {
AuthOption::Password { password, meta } => {
render_shape_literal(password);
touch(meta);
}
AuthOption::RandomPassword { meta } => {
touch(meta);
}
AuthOption::Plugin { plugin, meta } => {
render_shape_ident(plugin);
touch(meta);
}
AuthOption::PluginAs {
plugin,
auth_string,
meta,
} => {
render_shape_ident(plugin);
render_shape_literal(auth_string);
touch(meta);
}
AuthOption::PluginByPassword {
plugin,
password,
meta,
} => {
render_shape_ident(plugin);
render_shape_literal(password);
touch(meta);
}
AuthOption::PluginByRandomPassword { plugin, meta } => {
render_shape_ident(plugin);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_user(node: &AlterUser) {
match node {
AlterUser::Modify {
if_exists,
users,
require,
resource_options,
password_lock_options,
attribute,
meta,
} => {
touch(if_exists);
for item in users.iter() {
render_shape_alter_user_spec(item);
}
if let Some(item) = require.as_ref() {
render_shape_tls_requirement(item);
}
for item in resource_options.iter() {
render_shape_resource_limit(item);
}
for item in password_lock_options.iter() {
render_shape_password_lock_option(item);
}
if let Some(item) = attribute.as_ref() {
render_shape_user_attribute(item);
}
touch(meta);
}
AlterUser::DefaultRole {
if_exists,
user,
roles,
meta,
} => {
touch(if_exists);
render_shape_account_name(user);
render_shape_default_role_target(roles);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_user_spec(node: &AlterUserSpec) {
let AlterUserSpec {
account,
auth,
replace,
retain_current_password,
discard_old_password,
meta,
} = node;
render_shape_account_name(account);
if let Some(item) = auth.as_ref() {
render_shape_auth_option(item);
}
if let Some(item) = replace.as_ref() {
render_shape_literal(item);
}
touch(retain_current_password);
touch(discard_old_password);
touch(meta);
}
pub(crate) fn render_shape_default_role_target(node: &DefaultRoleTarget) {
match node {
DefaultRoleTarget::All { meta } => {
touch(meta);
}
DefaultRoleTarget::None { meta } => {
touch(meta);
}
DefaultRoleTarget::Roles { roles, meta } => {
for item in roles.iter() {
render_shape_account_name(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_user_role_list(node: &UserRoleList) {
let UserRoleList {
kind,
if_guard,
names,
meta,
} = node;
render_shape_user_role_list_kind(kind);
touch(if_guard);
for item in names.iter() {
render_shape_account_name(item);
}
touch(meta);
}
pub(crate) fn render_shape_user_role_list_kind(node: &UserRoleListKind) {
match node {
UserRoleListKind::DropUser => {}
UserRoleListKind::CreateRole => {}
UserRoleListKind::DropRole => {}
}
}
pub(crate) fn render_shape_tls_requirement(node: &TlsRequirement) {
match node {
TlsRequirement::None { meta } => {
touch(meta);
}
TlsRequirement::Ssl { meta } => {
touch(meta);
}
TlsRequirement::X509 { meta } => {
touch(meta);
}
TlsRequirement::Options { options, meta } => {
for item in options.iter() {
render_shape_tls_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_tls_option(node: &TlsOption) {
match node {
TlsOption::Subject { value, meta } => {
render_shape_literal(value);
touch(meta);
}
TlsOption::Issuer { value, meta } => {
render_shape_literal(value);
touch(meta);
}
TlsOption::Cipher { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_resource_limit(node: &ResourceLimit) {
match node {
ResourceLimit::MaxQueriesPerHour { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ResourceLimit::MaxUpdatesPerHour { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ResourceLimit::MaxConnectionsPerHour { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ResourceLimit::MaxUserConnections { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_password_lock_option(node: &PasswordLockOption) {
match node {
PasswordLockOption::AccountLock { meta } => {
touch(meta);
}
PasswordLockOption::AccountUnlock { meta } => {
touch(meta);
}
PasswordLockOption::PasswordExpire { meta } => {
touch(meta);
}
PasswordLockOption::PasswordExpireDefault { meta } => {
touch(meta);
}
PasswordLockOption::PasswordExpireNever { meta } => {
touch(meta);
}
PasswordLockOption::PasswordExpireInterval { days, meta } => {
render_shape_literal(days);
touch(meta);
}
PasswordLockOption::PasswordHistory { count, meta } => {
render_shape_literal(count);
touch(meta);
}
PasswordLockOption::PasswordHistoryDefault { meta } => {
touch(meta);
}
PasswordLockOption::PasswordReuseInterval { days, meta } => {
render_shape_literal(days);
touch(meta);
}
PasswordLockOption::PasswordReuseIntervalDefault { meta } => {
touch(meta);
}
PasswordLockOption::PasswordRequireCurrent { meta } => {
touch(meta);
}
PasswordLockOption::PasswordRequireCurrentDefault { meta } => {
touch(meta);
}
PasswordLockOption::PasswordRequireCurrentOptional { meta } => {
touch(meta);
}
PasswordLockOption::FailedLoginAttempts { count, meta } => {
render_shape_literal(count);
touch(meta);
}
PasswordLockOption::PasswordLockTime { days, meta } => {
render_shape_literal(days);
touch(meta);
}
PasswordLockOption::PasswordLockTimeUnbounded { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_user_attribute(node: &UserAttribute) {
match node {
UserAttribute::Comment { comment, meta } => {
render_shape_literal(comment);
touch(meta);
}
UserAttribute::Attribute { attribute, meta } => {
render_shape_literal(attribute);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_table<X: Extension>(node: &CreateTable<X>) {
let CreateTable {
or_replace,
temporary,
unlogged,
if_not_exists,
name,
body,
inherits,
partition_by,
access_method,
options,
meta,
} = node;
touch(or_replace);
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
touch(unlogged);
touch(if_not_exists);
render_shape_object_name(name);
render_shape_create_table_body(body);
for item in inherits.iter() {
render_shape_object_name(item);
}
if let Some(item) = partition_by.as_ref() {
render_shape_partition_spec(item);
}
if let Some(item) = access_method.as_ref() {
render_shape_ident(item);
}
for item in options.iter() {
render_shape_create_table_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_temporary_table_kind(node: &TemporaryTableKind) {
match node {
TemporaryTableKind::Temp => {}
TemporaryTableKind::Temporary => {}
}
}
pub(crate) fn render_shape_create_table_body<X: Extension>(node: &CreateTableBody<X>) {
match node {
CreateTableBody::Definition { elements, meta } => {
for item in elements.iter() {
render_shape_table_element(item);
}
touch(meta);
}
CreateTableBody::AsQuery {
columns,
query,
with_data,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_query(query);
touch(with_data);
touch(meta);
}
CreateTableBody::AsExecute {
columns,
execute,
with_data,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_execute_statement(execute);
touch(with_data);
touch(meta);
}
CreateTableBody::PartitionOf {
parent,
elements,
bound,
meta,
} => {
render_shape_object_name(parent);
for item in elements.iter() {
render_shape_table_element(item);
}
render_shape_partition_bound(bound);
touch(meta);
}
CreateTableBody::OfType {
type_name,
elements,
meta,
} => {
render_shape_object_name(type_name);
for item in elements.iter() {
render_shape_table_element(item);
}
touch(meta);
}
CreateTableBody::LikeSource {
source,
parenthesized,
meta,
} => {
render_shape_object_name(source);
touch(parenthesized);
touch(meta);
}
}
}
pub(crate) fn render_shape_partition_spec<X: Extension>(node: &PartitionSpec<X>) {
let PartitionSpec {
strategy,
columns,
meta,
} = node;
render_shape_partition_strategy(strategy);
for item in columns.iter() {
render_shape_partition_elem(item);
}
touch(meta);
}
pub(crate) fn render_shape_partition_strategy(node: &PartitionStrategy) {
match node {
PartitionStrategy::List => {}
PartitionStrategy::Range => {}
PartitionStrategy::Hash => {}
}
}
pub(crate) fn render_shape_partition_elem<X: Extension>(node: &PartitionElem<X>) {
let PartitionElem {
expr,
parenthesized,
collation,
opclass,
meta,
} = node;
render_shape_expr(expr);
touch(parenthesized);
if let Some(item) = collation.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = opclass.as_ref() {
render_shape_object_name(item);
}
touch(meta);
}
pub(crate) fn render_shape_partition_bound<X: Extension>(node: &PartitionBound<X>) {
match node {
PartitionBound::List { values, meta } => {
for item in values.iter() {
render_shape_expr(item);
}
touch(meta);
}
PartitionBound::Range { from, to, meta } => {
for item in from.iter() {
render_shape_expr(item);
}
for item in to.iter() {
render_shape_expr(item);
}
touch(meta);
}
PartitionBound::Hash {
modulus,
remainder,
meta,
} => {
render_shape_literal(modulus);
render_shape_literal(remainder);
touch(meta);
}
PartitionBound::Default { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_table_element<X: Extension>(node: &TableElement<X>) {
match node {
TableElement::Column { column, meta } => {
render_shape_column_def(column);
touch(meta);
}
TableElement::Constraint { constraint, meta } => {
render_shape_table_constraint_def(constraint);
touch(meta);
}
TableElement::Like {
source,
options,
meta,
} => {
render_shape_object_name(source);
for item in options.iter() {
render_shape_table_like_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_table_like_option(node: &TableLikeOption) {
let TableLikeOption {
action,
feature,
meta,
} = node;
render_shape_table_like_action(action);
render_shape_table_like_feature(feature);
touch(meta);
}
pub(crate) fn render_shape_table_like_action(node: &TableLikeAction) {
match node {
TableLikeAction::Including => {}
TableLikeAction::Excluding => {}
}
}
pub(crate) fn render_shape_table_like_feature(node: &TableLikeFeature) {
match node {
TableLikeFeature::Comments => {}
TableLikeFeature::Compression => {}
TableLikeFeature::Constraints => {}
TableLikeFeature::Defaults => {}
TableLikeFeature::Generated => {}
TableLikeFeature::Identity => {}
TableLikeFeature::Indexes => {}
TableLikeFeature::Statistics => {}
TableLikeFeature::Storage => {}
TableLikeFeature::All => {}
}
}
pub(crate) fn render_shape_column_def<X: Extension>(node: &ColumnDef<X>) {
let ColumnDef {
name,
data_type,
storage,
compression,
constraints,
meta,
} = node;
render_shape_ident(name);
if let Some(item) = data_type.as_ref() {
render_shape_data_type(item);
}
if let Some(item) = storage.as_ref() {
render_shape_ident(item);
}
if let Some(item) = compression.as_ref() {
render_shape_ident(item);
}
for item in constraints.iter() {
render_shape_column_constraint(item);
}
touch(meta);
}
pub(crate) fn render_shape_column_constraint<X: Extension>(node: &ColumnConstraint<X>) {
let ColumnConstraint {
name,
option,
conflict,
characteristics,
meta,
} = node;
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
render_shape_column_option(option);
if let Some(item) = conflict.as_ref() {
render_shape_conflict_resolution(item);
}
if let Some(item) = characteristics.as_ref() {
render_shape_constraint_characteristics(item);
}
touch(meta);
}
pub(crate) fn render_shape_constraint_characteristics(node: &ConstraintCharacteristics) {
let ConstraintCharacteristics {
deferrable,
initially_deferred,
meta,
} = node;
touch(deferrable);
touch(initially_deferred);
touch(meta);
}
pub(crate) fn render_shape_column_option<X: Extension>(node: &ColumnOption<X>) {
match node {
ColumnOption::Null { meta } => {
touch(meta);
}
ColumnOption::NotNull { meta } => {
touch(meta);
}
ColumnOption::Default { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
ColumnOption::Generated { generated, meta } => {
render_shape_generated_column(generated);
touch(meta);
}
ColumnOption::Identity { identity, meta } => {
render_shape_identity_column(identity);
touch(meta);
}
ColumnOption::PrimaryKey {
ascending,
index_tablespace,
meta,
} => {
touch(ascending);
if let Some(item) = index_tablespace.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
ColumnOption::Unique {
nulls_not_distinct,
index_tablespace,
meta,
} => {
touch(nulls_not_distinct);
if let Some(item) = index_tablespace.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
ColumnOption::AutoIncrement { spelling, meta } => {
render_shape_auto_increment_spelling(spelling);
touch(meta);
}
ColumnOption::Collate { collation, meta } => {
render_shape_object_name(collation);
touch(meta);
}
ColumnOption::Check {
expr,
no_inherit,
meta,
} => {
render_shape_expr(expr);
touch(no_inherit);
touch(meta);
}
ColumnOption::References { reference, meta } => {
render_shape_foreign_key_ref(reference);
touch(meta);
}
ColumnOption::Bare { meta } => {
touch(meta);
}
ColumnOption::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_auto_increment_spelling(node: &AutoIncrementSpelling) {
match node {
AutoIncrementSpelling::Underscored => {}
AutoIncrementSpelling::Joined => {}
}
}
pub(crate) fn render_shape_foreign_key_ref(node: &ForeignKeyRef) {
let ForeignKeyRef {
table,
columns,
match_type,
on_delete,
on_update,
update_before_delete,
meta,
} = node;
render_shape_object_name(table);
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = match_type.as_ref() {
render_shape_foreign_key_match(item);
}
if let Some(item) = on_delete.as_ref() {
render_shape_referential_action(item);
}
if let Some(item) = on_update.as_ref() {
render_shape_referential_action(item);
}
touch(update_before_delete);
touch(meta);
}
pub(crate) fn render_shape_foreign_key_match(node: &ForeignKeyMatch) {
match node {
ForeignKeyMatch::Full => {}
ForeignKeyMatch::Partial => {}
ForeignKeyMatch::Simple => {}
}
}
pub(crate) fn render_shape_referential_action(node: &ReferentialAction) {
match node {
ReferentialAction::NoAction { meta } => {
touch(meta);
}
ReferentialAction::Restrict { meta } => {
touch(meta);
}
ReferentialAction::Cascade { meta } => {
touch(meta);
}
ReferentialAction::SetNull { columns, meta } => {
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
ReferentialAction::SetDefault { columns, meta } => {
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_generated_column<X: Extension>(node: &GeneratedColumn<X>) {
let GeneratedColumn {
expr,
storage,
spelling,
meta,
} = node;
render_shape_expr(expr);
if let Some(item) = storage.as_ref() {
render_shape_generated_column_storage(item);
}
render_shape_generated_column_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_generated_column_storage(node: &GeneratedColumnStorage) {
match node {
GeneratedColumnStorage::Stored => {}
GeneratedColumnStorage::Virtual => {}
}
}
pub(crate) fn render_shape_generated_column_spelling(node: &GeneratedColumnSpelling) {
match node {
GeneratedColumnSpelling::GeneratedAlways => {}
GeneratedColumnSpelling::Shorthand => {}
}
}
pub(crate) fn render_shape_identity_column<X: Extension>(node: &IdentityColumn<X>) {
let IdentityColumn {
generation,
options,
meta,
} = node;
render_shape_identity_generation(generation);
for item in options.iter() {
render_shape_identity_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_identity_generation(node: &IdentityGeneration) {
match node {
IdentityGeneration::Always => {}
IdentityGeneration::ByDefault => {}
}
}
pub(crate) fn render_shape_identity_option<X: Extension>(node: &IdentityOption<X>) {
match node {
IdentityOption::StartWith { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
IdentityOption::IncrementBy { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
IdentityOption::MinValue { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
IdentityOption::MaxValue { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
IdentityOption::Cache { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
IdentityOption::Cycle { cycle, meta } => {
touch(cycle);
touch(meta);
}
}
}
pub(crate) fn render_shape_table_constraint_def<X: Extension>(node: &TableConstraintDef<X>) {
let TableConstraintDef {
name,
constraint,
no_inherit,
not_valid,
characteristics,
meta,
} = node;
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
render_shape_table_constraint(constraint);
touch(no_inherit);
touch(not_valid);
if let Some(item) = characteristics.as_ref() {
render_shape_constraint_characteristics(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_constraint<X: Extension>(node: &TableConstraint<X>) {
match node {
TableConstraint::PrimaryKey {
columns,
include,
meta,
} => {
for item in columns.iter() {
render_shape_index_column(item);
}
for item in include.iter() {
render_shape_ident(item);
}
touch(meta);
}
TableConstraint::Unique {
columns,
nulls_not_distinct,
include,
meta,
} => {
for item in columns.iter() {
render_shape_index_column(item);
}
touch(nulls_not_distinct);
for item in include.iter() {
render_shape_ident(item);
}
touch(meta);
}
TableConstraint::Check { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
TableConstraint::Exclude { exclude, meta } => {
render_shape_exclude_constraint(exclude);
touch(meta);
}
TableConstraint::ForeignKey {
columns,
references,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_foreign_key_ref(references);
touch(meta);
}
TableConstraint::Bare { meta } => {
touch(meta);
}
TableConstraint::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_exclude_constraint<X: Extension>(node: &ExcludeConstraint<X>) {
let ExcludeConstraint {
method,
elements,
include,
with_params,
index_tablespace,
predicate,
meta,
} = node;
if let Some(item) = method.as_ref() {
render_shape_ident(item);
}
for item in elements.iter() {
render_shape_exclude_element(item);
}
for item in include.iter() {
render_shape_ident(item);
}
for item in with_params.iter() {
render_shape_table_storage_parameter(item);
}
if let Some(item) = index_tablespace.as_ref() {
render_shape_ident(item);
}
if let Some(item) = predicate.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_exclude_element<X: Extension>(node: &ExcludeElement<X>) {
let ExcludeElement {
expr,
parenthesized,
collation,
opclass,
opclass_params,
asc,
nulls_first,
operator,
meta,
} = node;
render_shape_expr(expr);
touch(parenthesized);
if let Some(item) = collation.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = opclass.as_ref() {
render_shape_object_name(item);
}
for item in opclass_params.iter() {
render_shape_table_storage_parameter(item);
}
touch(asc);
touch(nulls_first);
render_shape_exclude_operator(operator);
touch(meta);
}
pub(crate) fn render_shape_exclude_operator(node: &ExcludeOperator) {
let ExcludeOperator {
schema,
op,
spelling,
} = node;
render_shape_object_name(schema);
touch(op);
render_shape_named_operator_spelling(spelling);
}
pub(crate) fn render_shape_create_table_option<X: Extension>(node: &CreateTableOption<X>) {
let CreateTableOption { kind, meta } = node;
render_shape_create_table_option_kind(kind);
touch(meta);
}
pub(crate) fn render_shape_create_table_option_kind<X: Extension>(node: &CreateTableOptionKind<X>) {
match node {
CreateTableOptionKind::ColocateWith {
table,
columns,
meta,
} => {
render_shape_object_name(table);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
CreateTableOptionKind::InColocationGroup {
group,
columns,
meta,
} => {
render_shape_ident(group);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
CreateTableOptionKind::With { params, meta } => {
for item in params.iter() {
render_shape_table_storage_parameter(item);
}
touch(meta);
}
CreateTableOptionKind::OnCommit { action, meta } => {
render_shape_on_commit_action(action);
touch(meta);
}
CreateTableOptionKind::Tablespace { tablespace, meta } => {
render_shape_ident(tablespace);
touch(meta);
}
CreateTableOptionKind::KeyValue { option, meta } => {
render_shape_table_option(option);
touch(meta);
}
CreateTableOptionKind::WithoutRowid { meta } => {
touch(meta);
}
CreateTableOptionKind::Strict { meta } => {
touch(meta);
}
CreateTableOptionKind::WithoutOids { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_table_option(node: &TableOption) {
let TableOption { name, value, meta } = node;
render_shape_ident(name);
render_shape_table_option_value(value);
touch(meta);
}
pub(crate) fn render_shape_table_option_value(node: &TableOptionValue) {
match node {
TableOptionValue::Word { word, meta } => {
render_shape_ident(word);
touch(meta);
}
TableOptionValue::String { value, meta } => {
render_shape_literal(value);
touch(meta);
}
TableOptionValue::Number { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_on_commit_action(node: &OnCommitAction) {
match node {
OnCommitAction::PreserveRows => {}
OnCommitAction::DeleteRows => {}
OnCommitAction::Drop => {}
}
}
pub(crate) fn render_shape_table_storage_parameter<X: Extension>(node: &TableStorageParameter<X>) {
let TableStorageParameter { name, value, meta } = node;
render_shape_object_name(name);
if let Some(item) = value.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_table<X: Extension>(node: &AlterTable<X>) {
let AlterTable {
if_exists,
name,
actions,
meta,
} = node;
touch(if_exists);
render_shape_object_name(name);
for item in actions.iter() {
render_shape_alter_table_action(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_column_target(node: &AlterColumnTarget) {
let AlterColumnTarget { parts, meta } = node;
for item in parts.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_table_action<X: Extension>(node: &AlterTableAction<X>) {
match node {
AlterTableAction::SetColocationGroup { group, meta } => {
render_shape_ident(group);
touch(meta);
}
AlterTableAction::DropColocationGroup { meta } => {
touch(meta);
}
AlterTableAction::AddColumn {
if_not_exists,
column_keyword,
target,
column,
meta,
} => {
touch(if_not_exists);
touch(column_keyword);
if let Some(item) = target.as_ref() {
render_shape_alter_column_target(item);
}
render_shape_column_def(column);
touch(meta);
}
AlterTableAction::DropColumn {
if_exists,
column_keyword,
name,
behavior,
meta,
} => {
touch(if_exists);
touch(column_keyword);
render_shape_alter_column_target(name);
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
AlterTableAction::AlterColumn {
column_keyword,
name,
change,
meta,
} => {
touch(column_keyword);
render_shape_ident(name);
render_shape_alter_column_action(change);
touch(meta);
}
AlterTableAction::AddConstraint { constraint, meta } => {
render_shape_table_constraint_def(constraint);
touch(meta);
}
AlterTableAction::DropConstraint {
if_exists,
name,
behavior,
meta,
} => {
touch(if_exists);
render_shape_ident(name);
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
AlterTableAction::DropPrimaryKey { behavior, meta } => {
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
AlterTableAction::SetOptions { params, meta } => {
for item in params.iter() {
render_shape_table_storage_parameter(item);
}
touch(meta);
}
AlterTableAction::RenameColumn {
column_keyword,
name,
new_name,
meta,
} => {
touch(column_keyword);
render_shape_alter_column_target(name);
render_shape_ident(new_name);
touch(meta);
}
AlterTableAction::RenameConstraint {
name,
new_name,
meta,
} => {
render_shape_ident(name);
render_shape_ident(new_name);
touch(meta);
}
AlterTableAction::RenameTable { new_name, meta } => {
render_shape_ident(new_name);
touch(meta);
}
AlterTableAction::AttachPartition {
partition,
bound,
meta,
} => {
render_shape_object_name(partition);
render_shape_partition_bound(bound);
touch(meta);
}
AlterTableAction::DetachPartition {
partition,
mode,
meta,
} => {
render_shape_object_name(partition);
if let Some(item) = mode.as_ref() {
render_shape_detach_partition_mode(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_detach_partition_mode(node: &DetachPartitionMode) {
match node {
DetachPartitionMode::Concurrently => {}
DetachPartitionMode::Finalize => {}
}
}
pub(crate) fn render_shape_alter_column_action<X: Extension>(node: &AlterColumnAction<X>) {
match node {
AlterColumnAction::SetDefault { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
AlterColumnAction::DropDefault { meta } => {
touch(meta);
}
AlterColumnAction::SetNotNull { meta } => {
touch(meta);
}
AlterColumnAction::DropNotNull { meta } => {
touch(meta);
}
AlterColumnAction::AddIdentity { identity, meta } => {
render_shape_identity_column(identity);
touch(meta);
}
AlterColumnAction::SetDataType {
set_data,
data_type,
using,
meta,
} => {
touch(set_data);
render_shape_data_type(data_type);
if let Some(item) = using.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_drop_statement(node: &DropStatement) {
let DropStatement {
object_kind,
if_exists,
names,
behavior,
meta,
} = node;
render_shape_drop_object_kind(object_kind);
touch(if_exists);
for item in names.iter() {
render_shape_object_name(item);
}
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
pub(crate) fn render_shape_drop_object_kind(node: &DropObjectKind) {
match node {
DropObjectKind::Table => {}
DropObjectKind::View => {}
DropObjectKind::MaterializedView => {}
DropObjectKind::Index => {}
DropObjectKind::Schema => {}
DropObjectKind::Type => {}
DropObjectKind::Sequence => {}
DropObjectKind::Macro => {}
DropObjectKind::MacroTable => {}
DropObjectKind::Trigger => {}
}
}
pub(crate) fn render_shape_drop_behavior(node: &DropBehavior) {
match node {
DropBehavior::Cascade => {}
DropBehavior::Restrict => {}
}
}
pub(crate) fn render_shape_drop_transform<X: Extension>(node: &DropTransform<X>) {
let DropTransform {
object,
if_exists,
behavior,
meta,
} = node;
render_shape_object_reference(object);
touch(if_exists);
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
pub(crate) fn render_shape_comment_target<X: Extension>(node: &CommentTarget<X>) {
match node {
CommentTarget::Table => {}
CommentTarget::Column => {}
CommentTarget::Database => {}
CommentTarget::View => {}
CommentTarget::MaterializedView => {}
CommentTarget::Index => {}
CommentTarget::Constraint => {}
CommentTarget::Procedure { arg_types } => {
if let Some(item) = arg_types.as_ref() {
for item1 in item.iter() {
render_shape_data_type(item1);
}
}
}
}
}
pub(crate) fn render_shape_comment_on_statement<X: Extension>(node: &CommentOnStatement<X>) {
let CommentOnStatement {
if_exists,
target,
name,
constraint_table,
comment,
meta,
} = node;
touch(if_exists);
render_shape_comment_target(target);
render_shape_object_name(name);
if let Some(item) = constraint_table.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = comment.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_schema<X: Extension>(node: &CreateSchema<X>) {
let CreateSchema {
if_not_exists,
name,
authorization,
elements,
meta,
} = node;
touch(if_not_exists);
if let Some(item) = name.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = authorization.as_ref() {
render_shape_ident(item);
}
for item in elements.iter() {
render_shape_statement(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_view<X: Extension>(node: &CreateView<X>) {
let CreateView {
or_replace,
options,
materialized,
recursive,
temporary,
if_not_exists,
name,
columns,
to,
query,
check_option,
with_data,
meta,
} = node;
touch(or_replace);
render_shape_view_options(options);
touch(materialized);
touch(recursive);
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
touch(if_not_exists);
render_shape_object_name(name);
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = to.as_ref() {
render_shape_object_name(item);
}
render_shape_query(query);
if let Some(item) = check_option.as_ref() {
render_shape_view_check_option(item);
}
touch(with_data);
touch(meta);
}
pub(crate) fn render_shape_refresh_materialized_view(node: &RefreshMaterializedView) {
let RefreshMaterializedView {
concurrently,
name,
with_data,
meta,
} = node;
touch(concurrently);
render_shape_object_name(name);
touch(with_data);
touch(meta);
}
pub(crate) fn render_shape_colocation_partition_kind(node: &ColocationPartitionKind) {
match node {
ColocationPartitionKind::Hash => {}
ColocationPartitionKind::Range => {}
}
}
pub(crate) fn render_shape_create_colocation_group(node: &CreateColocationGroup) {
let CreateColocationGroup {
if_not_exists,
name,
partition,
columns,
shards,
meta,
} = node;
touch(if_not_exists);
render_shape_ident(name);
render_shape_colocation_partition_kind(partition);
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_literal(shards);
touch(meta);
}
pub(crate) fn render_shape_drop_colocation_group(node: &DropColocationGroup) {
let DropColocationGroup {
if_exists,
name,
meta,
} = node;
touch(if_exists);
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_view_check_option(node: &ViewCheckOption) {
match node {
ViewCheckOption::Unspecified => {}
ViewCheckOption::Cascaded => {}
ViewCheckOption::Local => {}
}
}
pub(crate) fn render_shape_view_algorithm(node: &ViewAlgorithm) {
match node {
ViewAlgorithm::Undefined => {}
ViewAlgorithm::Merge => {}
ViewAlgorithm::TempTable => {}
}
}
pub(crate) fn render_shape_view_options(node: &ViewOptions) {
let ViewOptions {
algorithm,
definer,
sql_security,
} = node;
if let Some(item) = algorithm.as_ref() {
render_shape_view_algorithm(item);
}
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
if let Some(item) = sql_security.as_ref() {
render_shape_sql_security_context(item);
}
}
pub(crate) fn render_shape_alter_view<X: Extension>(node: &AlterView<X>) {
let AlterView {
options,
name,
columns,
query,
check_option,
meta,
} = node;
render_shape_view_options(options);
render_shape_object_name(name);
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_query(query);
if let Some(item) = check_option.as_ref() {
render_shape_view_check_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_secret<X: Extension>(node: &CreateSecret<X>) {
let CreateSecret {
persistent,
name,
options,
meta,
} = node;
touch(persistent);
render_shape_object_name(name);
for item in options.iter() {
render_shape_secret_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_secret_option<X: Extension>(node: &SecretOption<X>) {
let SecretOption { name, value, meta } = node;
render_shape_ident(name);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_drop_secret_stmt(node: &DropSecretStmt) {
let DropSecretStmt {
persistence,
if_exists,
name,
storage,
meta,
} = node;
render_shape_secret_persistence(persistence);
touch(if_exists);
render_shape_ident(name);
if let Some(item) = storage.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_secret_persistence(node: &SecretPersistence) {
match node {
SecretPersistence::Default => {}
SecretPersistence::Temporary => {}
SecretPersistence::Persistent => {}
}
}
pub(crate) fn render_shape_create_virtual_table(node: &CreateVirtualTable) {
let CreateVirtualTable {
if_not_exists,
name,
module,
args,
meta,
} = node;
touch(if_not_exists);
render_shape_object_name(name);
render_shape_ident(module);
if let Some(item) = args.as_ref() {
for item1 in item.iter() {
render_shape_module_arg(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_module_arg(node: &ModuleArg) {
let ModuleArg { text, meta } = node;
touch(text);
touch(meta);
}
pub(crate) fn render_shape_create_index<X: Extension>(node: &CreateIndex<X>) {
let CreateIndex {
unique,
concurrently,
if_not_exists,
name,
table,
using,
columns,
with_params,
predicate,
meta,
} = node;
touch(unique);
touch(concurrently);
touch(if_not_exists);
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
render_shape_object_name(table);
if let Some(item) = using.as_ref() {
render_shape_ident(item);
}
for item in columns.iter() {
render_shape_index_column(item);
}
for item in with_params.iter() {
render_shape_table_storage_parameter(item);
}
if let Some(item) = predicate.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_index_column<X: Extension>(node: &IndexColumn<X>) {
let IndexColumn {
expr,
asc,
nulls_first,
meta,
} = node;
render_shape_expr(expr);
touch(asc);
touch(nulls_first);
touch(meta);
}
pub(crate) fn render_shape_create_trigger<X: Extension>(node: &CreateTrigger<X>) {
let CreateTrigger {
temporary,
if_not_exists,
name,
timing,
event,
table,
for_each_row,
when,
body,
meta,
} = node;
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
touch(if_not_exists);
render_shape_object_name(name);
if let Some(item) = timing.as_ref() {
render_shape_trigger_timing(item);
}
render_shape_trigger_event(event);
render_shape_object_name(table);
touch(for_each_row);
if let Some(item) = when.as_ref() {
render_shape_expr(item);
}
for item in body.iter() {
render_shape_statement(item);
}
touch(meta);
}
pub(crate) fn render_shape_trigger_timing(node: &TriggerTiming) {
match node {
TriggerTiming::Before => {}
TriggerTiming::After => {}
TriggerTiming::InsteadOf => {}
}
}
pub(crate) fn render_shape_trigger_event(node: &TriggerEvent) {
match node {
TriggerEvent::Delete { meta } => {
touch(meta);
}
TriggerEvent::Insert { meta } => {
touch(meta);
}
TriggerEvent::Update { columns, meta } => {
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_create_stored_trigger<X: Extension>(node: &CreateStoredTrigger<X>) {
let CreateStoredTrigger {
definer,
if_not_exists,
name,
timing,
event,
table,
ordering,
body,
meta,
} = node;
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
touch(if_not_exists);
render_shape_object_name(name);
render_shape_trigger_timing(timing);
render_shape_trigger_event(event);
render_shape_object_name(table);
if let Some(item) = ordering.as_ref() {
render_shape_trigger_order(item);
}
render_shape_statement(body);
touch(meta);
}
pub(crate) fn render_shape_trigger_order(node: &TriggerOrder) {
match node {
TriggerOrder::Follows { anchor, meta } => {
render_shape_ident(anchor);
touch(meta);
}
TriggerOrder::Precedes { anchor, meta } => {
render_shape_ident(anchor);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_database(node: &CreateDatabase) {
let CreateDatabase {
if_not_exists,
name,
meta,
} = node;
touch(if_not_exists);
render_shape_object_name(name);
touch(meta);
}
pub(crate) fn render_shape_create_function<X: Extension>(node: &CreateFunction<X>) {
let CreateFunction {
or_replace,
definer,
if_not_exists,
name,
params,
returns,
options,
body,
meta,
} = node;
touch(or_replace);
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
touch(if_not_exists);
render_shape_object_name(name);
for item in params.iter() {
render_shape_function_param(item);
}
if let Some(item) = returns.as_ref() {
render_shape_data_type(item);
}
for item in options.iter() {
render_shape_function_option(item);
}
if let Some(item) = body.as_ref() {
render_shape_function_body(item);
}
touch(meta);
}
pub(crate) fn render_shape_function_param<X: Extension>(node: &FunctionParam<X>) {
let FunctionParam {
mode,
name,
data_type,
default,
meta,
} = node;
if let Some(item) = mode.as_ref() {
render_shape_function_param_mode(item);
}
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
render_shape_data_type(data_type);
if let Some(item) = default.as_ref() {
render_shape_function_param_default(item);
}
touch(meta);
}
pub(crate) fn render_shape_function_param_mode(node: &FunctionParamMode) {
match node {
FunctionParamMode::In => {}
FunctionParamMode::Out => {}
FunctionParamMode::InOut => {}
FunctionParamMode::Variadic => {}
}
}
pub(crate) fn render_shape_function_param_default<X: Extension>(node: &FunctionParamDefault<X>) {
let FunctionParamDefault {
spelling,
value,
meta,
} = node;
render_shape_function_param_default_spelling(spelling);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_function_param_default_spelling(node: &FunctionParamDefaultSpelling) {
match node {
FunctionParamDefaultSpelling::Default => {}
FunctionParamDefaultSpelling::Equals => {}
}
}
pub(crate) fn render_shape_function_option<X: Extension>(node: &FunctionOption<X>) {
match node {
FunctionOption::Language { name, meta } => {
render_shape_language_name(name);
touch(meta);
}
FunctionOption::As { body, meta } => {
render_shape_function_body(body);
touch(meta);
}
FunctionOption::NullBehavior { behavior, meta } => {
render_shape_function_null_behavior(behavior);
touch(meta);
}
FunctionOption::Deterministic { not, meta } => {
touch(not);
touch(meta);
}
FunctionOption::DataAccess { access, meta } => {
render_shape_sql_data_access(access);
touch(meta);
}
FunctionOption::SqlSecurity { context, meta } => {
render_shape_sql_security_context(context);
touch(meta);
}
FunctionOption::Comment { comment, meta } => {
render_shape_literal(comment);
touch(meta);
}
}
}
pub(crate) fn render_shape_sql_data_access(node: &SqlDataAccess) {
match node {
SqlDataAccess::ContainsSql => {}
SqlDataAccess::NoSql => {}
SqlDataAccess::ReadsSqlData => {}
SqlDataAccess::ModifiesSqlData => {}
}
}
pub(crate) fn render_shape_sql_security_context(node: &SqlSecurityContext) {
match node {
SqlSecurityContext::Definer => {}
SqlSecurityContext::Invoker => {}
}
}
pub(crate) fn render_shape_function_body<X: Extension>(node: &FunctionBody<X>) {
match node {
FunctionBody::Definition { definition, meta } => {
render_shape_literal(definition);
touch(meta);
}
FunctionBody::Return { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
FunctionBody::Block { body, meta } => {
render_shape_statement(body);
touch(meta);
}
}
}
pub(crate) fn render_shape_function_null_behavior(node: &FunctionNullBehavior) {
match node {
FunctionNullBehavior::CalledOnNull => {}
FunctionNullBehavior::ReturnsNullOnNull => {}
FunctionNullBehavior::Strict => {}
}
}
pub(crate) fn render_shape_definer(node: &Definer) {
match node {
Definer::Account { user, host, meta } => {
render_shape_ident(user);
if let Some(item) = host.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
Definer::CurrentUser { parens, meta } => {
touch(parens);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_procedure<X: Extension>(node: &CreateProcedure<X>) {
let CreateProcedure {
definer,
if_not_exists,
name,
params,
characteristics,
body,
meta,
} = node;
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
touch(if_not_exists);
render_shape_object_name(name);
for item in params.iter() {
render_shape_function_param(item);
}
for item in characteristics.iter() {
render_shape_function_option(item);
}
render_shape_statement(body);
touch(meta);
}
pub(crate) fn render_shape_routine_kind(node: &RoutineKind) {
match node {
RoutineKind::Procedure => {}
RoutineKind::Function => {}
}
}
pub(crate) fn render_shape_alter_routine<X: Extension>(node: &AlterRoutine<X>) {
let AlterRoutine {
kind,
name,
characteristics,
meta,
} = node;
render_shape_routine_kind(kind);
render_shape_object_name(name);
for item in characteristics.iter() {
render_shape_function_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_event_schedule<X: Extension>(node: &EventSchedule<X>) {
match node {
EventSchedule::At { at, meta } => {
render_shape_expr(at);
touch(meta);
}
EventSchedule::Every {
value,
unit,
starts,
ends,
meta,
} => {
render_shape_expr(value);
render_shape_interval_fields(unit);
if let Some(item) = starts.as_ref() {
render_shape_expr(item);
}
if let Some(item) = ends.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_event_on_completion(node: &EventOnCompletion) {
match node {
EventOnCompletion::Preserve => {}
EventOnCompletion::NotPreserve => {}
}
}
pub(crate) fn render_shape_event_status(node: &EventStatus) {
match node {
EventStatus::Enable => {}
EventStatus::Disable => {}
EventStatus::DisableOnReplica(field0) => {
render_shape_replica_spelling(field0);
}
}
}
pub(crate) fn render_shape_replica_spelling(node: &ReplicaSpelling) {
match node {
ReplicaSpelling::Slave => {}
ReplicaSpelling::Replica => {}
}
}
pub(crate) fn render_shape_create_event<X: Extension>(node: &CreateEvent<X>) {
let CreateEvent {
definer,
if_not_exists,
name,
schedule,
on_completion,
status,
comment,
body,
meta,
} = node;
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
touch(if_not_exists);
render_shape_object_name(name);
render_shape_event_schedule(schedule);
if let Some(item) = on_completion.as_ref() {
render_shape_event_on_completion(item);
}
if let Some(item) = status.as_ref() {
render_shape_event_status(item);
}
if let Some(item) = comment.as_ref() {
render_shape_literal(item);
}
render_shape_statement(body);
touch(meta);
}
pub(crate) fn render_shape_alter_event<X: Extension>(node: &AlterEvent<X>) {
let AlterEvent {
definer,
name,
schedule,
on_completion,
rename_to,
status,
comment,
body,
meta,
} = node;
if let Some(item) = definer.as_ref() {
render_shape_definer(item);
}
render_shape_object_name(name);
if let Some(item) = schedule.as_ref() {
render_shape_event_schedule(item);
}
if let Some(item) = on_completion.as_ref() {
render_shape_event_on_completion(item);
}
if let Some(item) = rename_to.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = status.as_ref() {
render_shape_event_status(item);
}
if let Some(item) = comment.as_ref() {
render_shape_literal(item);
}
if let Some(item) = body.as_ref() {
render_shape_statement(item);
}
touch(meta);
}
pub(crate) fn render_shape_drop_event(node: &DropEvent) {
let DropEvent {
if_exists,
name,
meta,
} = node;
touch(if_exists);
render_shape_object_name(name);
touch(meta);
}
pub(crate) fn render_shape_drop_database(node: &DropDatabase) {
let DropDatabase {
spelling,
if_exists,
name,
meta,
} = node;
render_shape_database_keyword(spelling);
touch(if_exists);
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_database_keyword(node: &DatabaseKeyword) {
match node {
DatabaseKeyword::Database => {}
DatabaseKeyword::Schema => {}
}
}
pub(crate) fn render_shape_drop_index_on_table(node: &DropIndexOnTable) {
let DropIndexOnTable {
name,
table,
options,
meta,
} = node;
render_shape_ident(name);
render_shape_object_name(table);
for item in options.iter() {
render_shape_index_lock_algorithm_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_index_lock_algorithm_option(node: &IndexLockAlgorithmOption) {
match node {
IndexLockAlgorithmOption::Algorithm { equals, value } => {
touch(equals);
render_shape_index_algorithm(value);
}
IndexLockAlgorithmOption::Lock { equals, value } => {
touch(equals);
render_shape_index_lock(value);
}
}
}
pub(crate) fn render_shape_index_algorithm(node: &IndexAlgorithm) {
match node {
IndexAlgorithm::Default => {}
IndexAlgorithm::Inplace => {}
IndexAlgorithm::Instant => {}
IndexAlgorithm::Copy => {}
}
}
pub(crate) fn render_shape_index_lock(node: &IndexLock) {
match node {
IndexLock::Default => {}
IndexLock::None => {}
IndexLock::Shared => {}
IndexLock::Exclusive => {}
}
}
pub(crate) fn render_shape_create_macro<X: Extension>(node: &CreateMacro<X>) {
let CreateMacro {
or_replace,
temporary,
spelling,
if_not_exists,
name,
params,
body,
meta,
} = node;
touch(or_replace);
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
render_shape_macro_spelling(spelling);
touch(if_not_exists);
render_shape_object_name(name);
for item in params.iter() {
render_shape_macro_param(item);
}
render_shape_macro_body(body);
touch(meta);
}
pub(crate) fn render_shape_macro_spelling(node: &MacroSpelling) {
match node {
MacroSpelling::Macro => {}
MacroSpelling::Function => {}
}
}
pub(crate) fn render_shape_macro_param<X: Extension>(node: &MacroParam<X>) {
let MacroParam {
name,
default,
meta,
} = node;
render_shape_ident(name);
if let Some(item) = default.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_macro_body<X: Extension>(node: &MacroBody<X>) {
match node {
MacroBody::Scalar { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
MacroBody::Table { query, meta } => {
render_shape_query(query);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_type<X: Extension>(node: &CreateType<X>) {
let CreateType {
or_replace,
temporary,
if_not_exists,
name,
definition,
meta,
} = node;
touch(or_replace);
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
touch(if_not_exists);
render_shape_object_name(name);
render_shape_create_type_definition(definition);
touch(meta);
}
pub(crate) fn render_shape_create_type_definition<X: Extension>(node: &CreateTypeDefinition<X>) {
match node {
CreateTypeDefinition::Enum { labels, meta } => {
for item in labels.iter() {
render_shape_literal(item);
}
touch(meta);
}
CreateTypeDefinition::EnumFromQuery { query, meta } => {
render_shape_query(query);
touch(meta);
}
CreateTypeDefinition::Alias { data_type, meta } => {
render_shape_data_type(data_type);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_sequence<X: Extension>(node: &CreateSequence<X>) {
let CreateSequence {
temporary,
if_not_exists,
name,
options,
meta,
} = node;
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
touch(if_not_exists);
render_shape_object_name(name);
for item in options.iter() {
render_shape_identity_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_extension(node: &CreateExtension) {
let CreateExtension {
if_not_exists,
name,
with,
options,
meta,
} = node;
touch(if_not_exists);
render_shape_ident(name);
touch(with);
for item in options.iter() {
render_shape_create_extension_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_extension_option(node: &CreateExtensionOption) {
match node {
CreateExtensionOption::Schema { name, meta } => {
render_shape_ident(name);
touch(meta);
}
CreateExtensionOption::Version { version, meta } => {
render_shape_extension_version(version);
touch(meta);
}
CreateExtensionOption::Cascade { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_extension_version(node: &ExtensionVersion) {
match node {
ExtensionVersion::Word { word, meta } => {
render_shape_ident(word);
touch(meta);
}
ExtensionVersion::String { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_extension<X: Extension>(node: &AlterExtension<X>) {
let AlterExtension { name, action, meta } = node;
render_shape_ident(name);
render_shape_alter_extension_action(action);
touch(meta);
}
pub(crate) fn render_shape_alter_extension_action<X: Extension>(node: &AlterExtensionAction<X>) {
match node {
AlterExtensionAction::Update { version, meta } => {
if let Some(item) = version.as_ref() {
render_shape_extension_version(item);
}
touch(meta);
}
AlterExtensionAction::Change { add, member, meta } => {
touch(add);
render_shape_object_reference(member);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_database(node: &AlterDatabase) {
let AlterDatabase {
if_exists,
name,
action,
meta,
} = node;
touch(if_exists);
render_shape_ident(name);
render_shape_alter_database_action(action);
touch(meta);
}
pub(crate) fn render_shape_alter_database_action(node: &AlterDatabaseAction) {
match node {
AlterDatabaseAction::SetAlias { new_name, meta } => {
render_shape_ident(new_name);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_sequence<X: Extension>(node: &AlterSequence<X>) {
let AlterSequence {
if_exists,
name,
options,
meta,
} = node;
touch(if_exists);
render_shape_object_name(name);
for item in options.iter() {
render_shape_alter_sequence_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_sequence_option<X: Extension>(node: &AlterSequenceOption<X>) {
match node {
AlterSequenceOption::Common { option, meta } => {
render_shape_identity_option(option);
touch(meta);
}
AlterSequenceOption::Restart { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
AlterSequenceOption::As { data_type, meta } => {
render_shape_data_type(data_type);
touch(meta);
}
AlterSequenceOption::OwnedBy { owner, meta } => {
if let Some(item) = owner.as_ref() {
render_shape_object_name(item);
}
touch(meta);
}
AlterSequenceOption::SequenceName { name, meta } => {
render_shape_object_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_alter_object_schema(node: &AlterObjectSchema) {
let AlterObjectSchema {
object_type,
if_exists,
name,
new_schema,
meta,
} = node;
render_shape_schema_relocation_object(object_type);
touch(if_exists);
render_shape_object_name(name);
render_shape_ident(new_schema);
touch(meta);
}
pub(crate) fn render_shape_schema_relocation_object(node: &SchemaRelocationObject) {
match node {
SchemaRelocationObject::Table => {}
SchemaRelocationObject::View => {}
SchemaRelocationObject::Sequence => {}
}
}
pub(crate) fn render_shape_object_reference<X: Extension>(node: &ObjectReference<X>) {
match node {
ObjectReference::Named { kind, name, meta } => {
render_shape_object_ref_kind(kind);
render_shape_object_name(name);
touch(meta);
}
ObjectReference::Routine {
kind,
signature,
meta,
} => {
render_shape_routine_object_kind(kind);
render_shape_routine_signature(signature);
touch(meta);
}
ObjectReference::Aggregate { name, args, meta } => {
render_shape_object_name(name);
render_shape_aggregate_args(args);
touch(meta);
}
ObjectReference::Operator {
schema,
op,
args,
meta,
} => {
render_shape_object_name(schema);
touch(op);
render_shape_operator_args(args);
touch(meta);
}
ObjectReference::OperatorClass {
family,
name,
access_method,
meta,
} => {
touch(family);
render_shape_object_name(name);
render_shape_ident(access_method);
touch(meta);
}
ObjectReference::Cast { from, to, meta } => {
render_shape_data_type(from);
render_shape_data_type(to);
touch(meta);
}
ObjectReference::Type { domain, name, meta } => {
touch(domain);
render_shape_data_type(name);
touch(meta);
}
ObjectReference::Transform {
type_name,
language,
meta,
} => {
render_shape_data_type(type_name);
render_shape_ident(language);
touch(meta);
}
ObjectReference::Trigger { name, table, meta } => {
render_shape_ident(name);
render_shape_object_name(table);
touch(meta);
}
}
}
pub(crate) fn render_shape_object_ref_kind(node: &ObjectRefKind) {
match node {
ObjectRefKind::Table => {}
ObjectRefKind::Sequence => {}
ObjectRefKind::View => {}
ObjectRefKind::MaterializedView => {}
ObjectRefKind::Index => {}
ObjectRefKind::ForeignTable => {}
ObjectRefKind::Collation => {}
ObjectRefKind::Conversion => {}
ObjectRefKind::Statistics => {}
ObjectRefKind::TextSearchParser => {}
ObjectRefKind::TextSearchDictionary => {}
ObjectRefKind::TextSearchTemplate => {}
ObjectRefKind::TextSearchConfiguration => {}
ObjectRefKind::AccessMethod => {}
ObjectRefKind::EventTrigger => {}
ObjectRefKind::Extension => {}
ObjectRefKind::ForeignDataWrapper => {}
ObjectRefKind::Language => {}
ObjectRefKind::Publication => {}
ObjectRefKind::Schema => {}
ObjectRefKind::Server => {}
ObjectRefKind::Database => {}
ObjectRefKind::Role => {}
ObjectRefKind::Tablespace => {}
}
}
pub(crate) fn render_shape_aggregate_args<X: Extension>(node: &AggregateArgs<X>) {
match node {
AggregateArgs::Star { meta } => {
touch(meta);
}
AggregateArgs::Types {
direct,
order_by,
meta,
} => {
for item in direct.iter() {
render_shape_data_type(item);
}
if let Some(item) = order_by.as_ref() {
for item1 in item.iter() {
render_shape_data_type(item1);
}
}
touch(meta);
}
}
}
pub(crate) fn render_shape_operator_args<X: Extension>(node: &OperatorArgs<X>) {
let OperatorArgs { left, right, meta } = node;
if let Some(item) = left.as_ref() {
render_shape_data_type(item);
}
if let Some(item) = right.as_ref() {
render_shape_data_type(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_object_depends<X: Extension>(node: &AlterObjectDepends<X>) {
let AlterObjectDepends {
object,
no,
extension,
meta,
} = node;
render_shape_object_reference(object);
touch(no);
render_shape_ident(extension);
touch(meta);
}
pub(crate) fn render_shape_create_server(node: &CreateServer) {
let CreateServer {
name,
wrapper,
options,
meta,
} = node;
render_shape_ident(name);
render_shape_ident(wrapper);
for item in options.iter() {
render_shape_server_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_server(node: &AlterServer) {
let AlterServer {
name,
options,
meta,
} = node;
render_shape_ident(name);
for item in options.iter() {
render_shape_server_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_drop_server(node: &DropServer) {
let DropServer {
if_exists,
name,
meta,
} = node;
touch(if_exists);
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_server_option(node: &ServerOption) {
let ServerOption { kind, value, meta } = node;
render_shape_server_option_kind(kind);
render_shape_literal(value);
touch(meta);
}
pub(crate) fn render_shape_server_option_kind(node: &ServerOptionKind) {
match node {
ServerOptionKind::Host => {}
ServerOptionKind::Database => {}
ServerOptionKind::User => {}
ServerOptionKind::Password => {}
ServerOptionKind::Socket => {}
ServerOptionKind::Owner => {}
ServerOptionKind::Port => {}
}
}
pub(crate) fn render_shape_alter_instance(node: &AlterInstance) {
let AlterInstance { action, meta } = node;
render_shape_alter_instance_action(action);
touch(meta);
}
pub(crate) fn render_shape_alter_instance_action(node: &AlterInstanceAction) {
match node {
AlterInstanceAction::RotateInnodbMasterKey { meta } => {
touch(meta);
}
AlterInstanceAction::RotateBinlogMasterKey { meta } => {
touch(meta);
}
AlterInstanceAction::ReloadTls {
channel,
no_rollback_on_error,
meta,
} => {
if let Some(item) = channel.as_ref() {
render_shape_ident(item);
}
touch(no_rollback_on_error);
touch(meta);
}
AlterInstanceAction::ReloadKeyring { meta } => {
touch(meta);
}
AlterInstanceAction::EnableInnodbRedoLog { meta } => {
touch(meta);
}
AlterInstanceAction::DisableInnodbRedoLog { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_create_spatial_reference_system(node: &CreateSpatialReferenceSystem) {
let CreateSpatialReferenceSystem {
or_replace,
if_not_exists,
srid,
attributes,
meta,
} = node;
touch(or_replace);
touch(if_not_exists);
render_shape_literal(srid);
for item in attributes.iter() {
render_shape_srs_attribute(item);
}
touch(meta);
}
pub(crate) fn render_shape_srs_attribute(node: &SrsAttribute) {
match node {
SrsAttribute::Name { value, meta } => {
render_shape_literal(value);
touch(meta);
}
SrsAttribute::Definition { value, meta } => {
render_shape_literal(value);
touch(meta);
}
SrsAttribute::Organization {
organization,
identifier,
meta,
} => {
render_shape_literal(organization);
render_shape_literal(identifier);
touch(meta);
}
SrsAttribute::Description { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_drop_spatial_reference_system(node: &DropSpatialReferenceSystem) {
let DropSpatialReferenceSystem {
if_exists,
srid,
meta,
} = node;
touch(if_exists);
render_shape_literal(srid);
touch(meta);
}
pub(crate) fn render_shape_create_resource_group(node: &CreateResourceGroup) {
let CreateResourceGroup {
name,
type_equals,
group_type,
vcpu,
thread_priority,
state,
meta,
} = node;
render_shape_ident(name);
touch(type_equals);
render_shape_resource_group_type(group_type);
if let Some(item) = vcpu.as_ref() {
render_shape_resource_group_vcpu(item);
}
if let Some(item) = thread_priority.as_ref() {
render_shape_resource_group_thread_priority(item);
}
if let Some(item) = state.as_ref() {
render_shape_resource_group_state(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_resource_group(node: &AlterResourceGroup) {
let AlterResourceGroup {
name,
vcpu,
thread_priority,
state,
force,
meta,
} = node;
render_shape_ident(name);
if let Some(item) = vcpu.as_ref() {
render_shape_resource_group_vcpu(item);
}
if let Some(item) = thread_priority.as_ref() {
render_shape_resource_group_thread_priority(item);
}
if let Some(item) = state.as_ref() {
render_shape_resource_group_state(item);
}
touch(force);
touch(meta);
}
pub(crate) fn render_shape_drop_resource_group(node: &DropResourceGroup) {
let DropResourceGroup { name, force, meta } = node;
render_shape_ident(name);
touch(force);
touch(meta);
}
pub(crate) fn render_shape_resource_group_type(node: &ResourceGroupType) {
match node {
ResourceGroupType::System => {}
ResourceGroupType::User => {}
}
}
pub(crate) fn render_shape_resource_group_state(node: &ResourceGroupState) {
match node {
ResourceGroupState::Enable => {}
ResourceGroupState::Disable => {}
}
}
pub(crate) fn render_shape_resource_group_vcpu(node: &ResourceGroupVcpu) {
let ResourceGroupVcpu {
equals,
ranges,
meta,
} = node;
touch(equals);
for item in ranges.iter() {
render_shape_vcpu_range(item);
}
touch(meta);
}
pub(crate) fn render_shape_vcpu_range(node: &VcpuRange) {
let VcpuRange { start, end, meta } = node;
render_shape_literal(start);
if let Some(item) = end.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_resource_group_thread_priority(node: &ResourceGroupThreadPriority) {
let ResourceGroupThreadPriority {
equals,
negative,
value,
meta,
} = node;
touch(equals);
touch(negative);
render_shape_literal(value);
touch(meta);
}
pub(crate) fn render_shape_alter_database_options(node: &AlterDatabaseOptions) {
let AlterDatabaseOptions {
spelling,
name,
options,
meta,
} = node;
render_shape_database_keyword(spelling);
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
for item in options.iter() {
render_shape_alter_database_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_database_option(node: &AlterDatabaseOption) {
match node {
AlterDatabaseOption::CharacterSet {
default,
keyword,
equals,
charset,
meta,
} => {
touch(default);
render_shape_charset_keyword(keyword);
touch(equals);
render_shape_ident(charset);
touch(meta);
}
AlterDatabaseOption::Collate {
default,
equals,
collation,
meta,
} => {
touch(default);
touch(equals);
render_shape_ident(collation);
touch(meta);
}
AlterDatabaseOption::Encryption {
default,
equals,
value,
meta,
} => {
touch(default);
touch(equals);
render_shape_literal(value);
touch(meta);
}
AlterDatabaseOption::ReadOnly {
equals,
value,
meta,
} => {
touch(equals);
render_shape_read_only_value(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_charset_keyword(node: &CharsetKeyword) {
match node {
CharsetKeyword::CharacterSet => {}
CharsetKeyword::Charset => {}
}
}
pub(crate) fn render_shape_read_only_value(node: &ReadOnlyValue) {
match node {
ReadOnlyValue::Default => {}
ReadOnlyValue::Off => {}
ReadOnlyValue::On => {}
}
}
pub(crate) fn render_shape_size_unit(node: &SizeUnit) {
match node {
SizeUnit::Kilo => {}
SizeUnit::Mega => {}
SizeUnit::Giga => {}
}
}
pub(crate) fn render_shape_size_literal(node: &SizeLiteral) {
let SizeLiteral { unit, meta } = node;
if let Some(item) = unit.as_ref() {
render_shape_size_unit(item);
}
touch(meta);
}
pub(crate) fn render_shape_tablespace_size_option(node: &TablespaceSizeOption) {
match node {
TablespaceSizeOption::InitialSize => {}
TablespaceSizeOption::AutoextendSize => {}
TablespaceSizeOption::MaxSize => {}
TablespaceSizeOption::ExtentSize => {}
TablespaceSizeOption::UndoBufferSize => {}
TablespaceSizeOption::RedoBufferSize => {}
TablespaceSizeOption::FileBlockSize => {}
}
}
pub(crate) fn render_shape_tablespace_option(node: &TablespaceOption) {
match node {
TablespaceOption::Size {
kind,
equals,
size,
meta,
} => {
render_shape_tablespace_size_option(kind);
touch(equals);
render_shape_size_literal(size);
touch(meta);
}
TablespaceOption::Nodegroup {
equals,
value,
meta,
} => {
touch(equals);
render_shape_literal(value);
touch(meta);
}
TablespaceOption::Engine {
storage,
equals,
name,
meta,
} => {
touch(storage);
touch(equals);
render_shape_ident(name);
touch(meta);
}
TablespaceOption::Wait { negated, meta } => {
touch(negated);
touch(meta);
}
TablespaceOption::Comment {
equals,
value,
meta,
} => {
touch(equals);
render_shape_literal(value);
touch(meta);
}
TablespaceOption::Encryption {
equals,
value,
meta,
} => {
touch(equals);
render_shape_literal(value);
touch(meta);
}
TablespaceOption::EngineAttribute {
equals,
value,
meta,
} => {
touch(equals);
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_create_tablespace(node: &CreateTablespace) {
let CreateTablespace {
undo,
name,
datafile,
use_logfile_group,
options,
meta,
} = node;
touch(undo);
render_shape_ident(name);
if let Some(item) = datafile.as_ref() {
render_shape_literal(item);
}
if let Some(item) = use_logfile_group.as_ref() {
render_shape_ident(item);
}
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_undo_tablespace_state(node: &UndoTablespaceState) {
match node {
UndoTablespaceState::Active => {}
UndoTablespaceState::Inactive => {}
}
}
pub(crate) fn render_shape_alter_tablespace(node: &AlterTablespace) {
let AlterTablespace { name, action, meta } = node;
render_shape_ident(name);
render_shape_alter_tablespace_action(action);
touch(meta);
}
pub(crate) fn render_shape_alter_tablespace_action(node: &AlterTablespaceAction) {
match node {
AlterTablespaceAction::AddDatafile {
datafile,
options,
meta,
} => {
render_shape_literal(datafile);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
AlterTablespaceAction::DropDatafile {
datafile,
options,
meta,
} => {
render_shape_literal(datafile);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
AlterTablespaceAction::Rename { new_name, meta } => {
render_shape_ident(new_name);
touch(meta);
}
AlterTablespaceAction::Options { options, meta } => {
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
AlterTablespaceAction::SetState {
state,
options,
meta,
} => {
render_shape_undo_tablespace_state(state);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_drop_tablespace(node: &DropTablespace) {
let DropTablespace {
undo,
name,
options,
meta,
} = node;
touch(undo);
render_shape_ident(name);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_create_logfile_group(node: &CreateLogfileGroup) {
let CreateLogfileGroup {
name,
undofile,
options,
meta,
} = node;
render_shape_ident(name);
render_shape_literal(undofile);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_alter_logfile_group(node: &AlterLogfileGroup) {
let AlterLogfileGroup {
name,
undofile,
options,
meta,
} = node;
render_shape_ident(name);
render_shape_literal(undofile);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_drop_logfile_group(node: &DropLogfileGroup) {
let DropLogfileGroup {
name,
options,
meta,
} = node;
render_shape_ident(name);
for item in options.iter() {
render_shape_tablespace_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_insert_verb(node: &InsertVerb) {
match node {
InsertVerb::Insert => {}
InsertVerb::Replace => {}
}
}
pub(crate) fn render_shape_insert_modifier(node: &InsertModifier) {
match node {
InsertModifier::Ignore => {}
InsertModifier::Overwrite => {}
}
}
pub(crate) fn render_shape_insert_column_matching(node: &InsertColumnMatching) {
match node {
InsertColumnMatching::ByName => {}
InsertColumnMatching::ByPosition => {}
}
}
pub(crate) fn render_shape_conflict_resolution(node: &ConflictResolution) {
match node {
ConflictResolution::Rollback => {}
ConflictResolution::Abort => {}
ConflictResolution::Fail => {}
ConflictResolution::Ignore => {}
ConflictResolution::Replace => {}
}
}
pub(crate) fn render_shape_insert<X: Extension>(node: &Insert<X>) {
let Insert {
verb,
modifier,
or_action,
with,
target,
column_matching,
overriding,
source,
row_alias,
upsert,
returning,
meta,
} = node;
render_shape_insert_verb(verb);
if let Some(item) = modifier.as_ref() {
render_shape_insert_modifier(item);
}
if let Some(item) = or_action.as_ref() {
render_shape_conflict_resolution(item);
}
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
render_shape_insert_target(target);
if let Some(item) = column_matching.as_ref() {
render_shape_insert_column_matching(item);
}
if let Some(item) = overriding.as_ref() {
render_shape_insert_overriding(item);
}
render_shape_insert_source(source);
if let Some(item) = row_alias.as_ref() {
render_shape_table_alias(item);
}
if let Some(item) = upsert.as_ref() {
render_shape_upsert(item);
}
if let Some(item) = returning.as_ref() {
render_shape_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_insert_target(node: &InsertTarget) {
let InsertTarget {
name,
alias,
alias_spelling,
columns,
meta,
} = node;
render_shape_object_name(name);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_insert_overriding(node: &InsertOverriding) {
match node {
InsertOverriding::SystemValue => {}
InsertOverriding::UserValue => {}
}
}
pub(crate) fn render_shape_insert_source<X: Extension>(node: &InsertSource<X>) {
match node {
InsertSource::DefaultValues { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
InsertSource::Values { values, meta } => {
render_shape_insert_values(values);
touch(meta);
}
InsertSource::Query { query, meta } => {
render_shape_query(query);
touch(meta);
}
InsertSource::Set { assignments, meta } => {
for item in assignments.iter() {
render_shape_update_assignment(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_insert_values<X: Extension>(node: &InsertValues<X>) {
let InsertValues { rows, meta } = node;
for item in rows.iter() {
for item1 in item.iter() {
render_shape_insert_value(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_insert_value<X: Extension>(node: &InsertValue<X>) {
match node {
InsertValue::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
InsertValue::Default { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
}
}
pub(crate) fn render_shape_dml_target(node: &DmlTarget) {
let DmlTarget {
name,
inheritance,
alias,
alias_spelling,
meta,
} = node;
render_shape_object_name(name);
render_shape_relation_inheritance(inheritance);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
pub(crate) fn render_shape_update<X: Extension>(node: &Update<X>) {
let Update {
with,
or_action,
target,
target_joins,
assignments,
from,
selection,
order_by,
limit,
returning,
meta,
} = node;
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
if let Some(item) = or_action.as_ref() {
render_shape_conflict_resolution(item);
}
render_shape_dml_target(target);
for item in target_joins.iter() {
render_shape_join(item);
}
for item in assignments.iter() {
render_shape_update_assignment(item);
}
for item in from.iter() {
render_shape_table_with_joins(item);
}
if let Some(item) = selection.as_ref() {
render_shape_dml_selection(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
if let Some(item) = returning.as_ref() {
render_shape_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_update_assignment<X: Extension>(node: &UpdateAssignment<X>) {
match node {
UpdateAssignment::Single {
target,
value,
meta,
} => {
render_shape_object_name(target);
render_shape_update_value(value);
touch(meta);
}
UpdateAssignment::Tuple {
targets,
source,
meta,
} => {
for item in targets.iter() {
render_shape_object_name(item);
}
render_shape_update_tuple_source(source);
touch(meta);
}
}
}
pub(crate) fn render_shape_update_value<X: Extension>(node: &UpdateValue<X>) {
match node {
UpdateValue::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
UpdateValue::Default { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
}
}
pub(crate) fn render_shape_update_tuple_source<X: Extension>(node: &UpdateTupleSource<X>) {
match node {
UpdateTupleSource::Row {
explicit,
values,
meta,
} => {
touch(explicit);
for item in values.iter() {
render_shape_update_value(item);
}
touch(meta);
}
UpdateTupleSource::Subquery { query, meta } => {
render_shape_query(query);
touch(meta);
}
UpdateTupleSource::Default { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
}
}
pub(crate) fn render_shape_delete<X: Extension>(node: &Delete<X>) {
let Delete {
with,
target,
additional_targets,
target_joins,
using,
selection,
order_by,
limit,
returning,
meta,
} = node;
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
render_shape_dml_target(target);
for item in additional_targets.iter() {
render_shape_dml_target(item);
}
for item in target_joins.iter() {
render_shape_join(item);
}
for item in using.iter() {
render_shape_table_with_joins(item);
}
if let Some(item) = selection.as_ref() {
render_shape_dml_selection(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
if let Some(item) = returning.as_ref() {
render_shape_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_dml_selection<X: Extension>(node: &DmlSelection<X>) {
match node {
DmlSelection::Where { condition, meta } => {
render_shape_expr(condition);
touch(meta);
}
DmlSelection::CurrentOf { cursor, meta } => {
render_shape_ident(cursor);
touch(meta);
}
}
}
pub(crate) fn render_shape_default_value(node: &DefaultValue) {
let DefaultValue { meta } = node;
touch(meta);
}
pub(crate) fn render_shape_returning<X: Extension>(node: &Returning<X>) {
let Returning { items, meta } = node;
for item in items.iter() {
render_shape_select_item(item);
}
touch(meta);
}
pub(crate) fn render_shape_upsert<X: Extension>(node: &Upsert<X>) {
match node {
Upsert::OnConflict { conflict, meta } => {
render_shape_on_conflict(conflict);
touch(meta);
}
Upsert::OnDuplicateKeyUpdate { assignments, meta } => {
for item in assignments.iter() {
render_shape_update_assignment(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_on_conflict<X: Extension>(node: &OnConflict<X>) {
let OnConflict {
target,
action,
meta,
} = node;
if let Some(item) = target.as_ref() {
render_shape_conflict_target(item);
}
render_shape_conflict_action(action);
touch(meta);
}
pub(crate) fn render_shape_conflict_target<X: Extension>(node: &ConflictTarget<X>) {
match node {
ConflictTarget::Index {
columns,
predicate,
meta,
} => {
for item in columns.iter() {
render_shape_expr(item);
}
if let Some(item) = predicate.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
ConflictTarget::Constraint { name, meta } => {
render_shape_ident(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_conflict_action<X: Extension>(node: &ConflictAction<X>) {
match node {
ConflictAction::Nothing { meta } => {
touch(meta);
}
ConflictAction::Update {
assignments,
selection,
meta,
} => {
for item in assignments.iter() {
render_shape_update_assignment(item);
}
if let Some(item) = selection.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_merge<X: Extension>(node: &Merge<X>) {
let Merge {
with,
target,
using,
on,
clauses,
returning,
meta,
} = node;
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
render_shape_dml_target(target);
render_shape_table_with_joins(using);
render_shape_expr(on);
for item in clauses.iter() {
render_shape_merge_when_clause(item);
}
if let Some(item) = returning.as_ref() {
render_shape_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_merge_when_clause<X: Extension>(node: &MergeWhenClause<X>) {
let MergeWhenClause {
match_kind,
condition,
action,
meta,
} = node;
render_shape_merge_match_kind(match_kind);
if let Some(item) = condition.as_ref() {
render_shape_expr(item);
}
render_shape_merge_action(action);
touch(meta);
}
pub(crate) fn render_shape_merge_match_kind(node: &MergeMatchKind) {
match node {
MergeMatchKind::Matched => {}
MergeMatchKind::NotMatchedByTarget => {}
MergeMatchKind::NotMatchedBySource => {}
}
}
pub(crate) fn render_shape_merge_action<X: Extension>(node: &MergeAction<X>) {
match node {
MergeAction::Insert {
columns,
overriding,
values,
additional_rows,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = overriding.as_ref() {
render_shape_insert_overriding(item);
}
for item in values.iter() {
render_shape_insert_value(item);
}
for item in additional_rows.iter() {
for item1 in item.iter() {
render_shape_insert_value(item1);
}
}
touch(meta);
}
MergeAction::InsertDefault { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
MergeAction::Update { assignments, meta } => {
for item in assignments.iter() {
render_shape_update_assignment(item);
}
touch(meta);
}
MergeAction::UpdateStar { meta } => {
touch(meta);
}
MergeAction::InsertStar { meta } => {
touch(meta);
}
MergeAction::InsertByName { star, meta } => {
touch(star);
touch(meta);
}
MergeAction::Error { meta } => {
touch(meta);
}
MergeAction::Delete { meta } => {
touch(meta);
}
MergeAction::DoNothing { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_expr<X: Extension>(node: &Expr<X>) {
match node {
Expr::Column { name, meta } => {
render_shape_object_name(name);
touch(meta);
}
Expr::Literal { literal, meta } => {
render_shape_literal(literal);
touch(meta);
}
Expr::BinaryOp {
left,
op,
right,
meta,
} => {
render_shape_expr(left);
render_shape_binary_operator(op);
render_shape_expr(right);
touch(meta);
}
Expr::UnaryOp { op, expr, meta } => {
render_shape_unary_operator(op);
render_shape_expr(expr);
touch(meta);
}
Expr::Function { call, meta } => {
render_shape_function_call(call);
touch(meta);
}
Expr::Case { case, meta } => {
render_shape_case_expr(case);
touch(meta);
}
Expr::Extract { extract, meta } => {
render_shape_extract_expr(extract);
touch(meta);
}
Expr::Cast {
expr,
data_type,
syntax,
try_cast,
meta,
} => {
render_shape_expr(expr);
render_shape_data_type(data_type);
render_shape_cast_syntax(syntax);
touch(try_cast);
touch(meta);
}
Expr::IsNull {
expr,
negated,
spelling,
meta,
} => {
render_shape_expr(expr);
touch(negated);
render_shape_null_test_spelling(spelling);
touch(meta);
}
Expr::IsTruth {
expr,
value,
negated,
meta,
} => {
render_shape_expr(expr);
render_shape_truth_value(value);
touch(negated);
touch(meta);
}
Expr::IsNormalized {
expr,
form,
negated,
meta,
} => {
render_shape_expr(expr);
if let Some(item) = form.as_ref() {
render_shape_normalization_form(item);
}
touch(negated);
touch(meta);
}
Expr::Between {
expr,
low,
high,
negated,
symmetric,
meta,
} => {
render_shape_expr(expr);
render_shape_expr(low);
render_shape_expr(high);
touch(negated);
touch(symmetric);
touch(meta);
}
Expr::Like {
expr,
pattern,
escape,
negated,
spelling,
meta,
} => {
render_shape_expr(expr);
render_shape_expr(pattern);
if let Some(item) = escape.as_ref() {
render_shape_expr(item);
}
touch(negated);
render_shape_like_spelling(spelling);
touch(meta);
}
Expr::InList {
expr,
list,
negated,
meta,
} => {
render_shape_expr(expr);
for item in list.iter() {
render_shape_expr(item);
}
touch(negated);
touch(meta);
}
Expr::InSubquery {
expr,
subquery,
negated,
meta,
} => {
render_shape_expr(expr);
render_shape_query(subquery);
touch(negated);
touch(meta);
}
Expr::InExpr {
expr,
rhs,
negated,
meta,
} => {
render_shape_expr(expr);
render_shape_expr(rhs);
touch(negated);
touch(meta);
}
Expr::Exists { query, meta } => {
render_shape_query(query);
touch(meta);
}
Expr::QuantifiedComparison {
left,
op,
quantifier,
subquery,
meta,
} => {
render_shape_expr(left);
render_shape_binary_operator(op);
render_shape_quantifier(quantifier);
render_shape_query(subquery);
touch(meta);
}
Expr::QuantifiedList {
left,
op,
quantifier,
array,
meta,
} => {
render_shape_expr(left);
render_shape_binary_operator(op);
render_shape_quantifier(quantifier);
render_shape_expr(array);
touch(meta);
}
Expr::QuantifiedLike {
left,
pattern,
quantifier,
negated,
spelling,
meta,
} => {
render_shape_expr(left);
render_shape_expr(pattern);
render_shape_quantifier(quantifier);
touch(negated);
render_shape_like_spelling(spelling);
touch(meta);
}
Expr::Subquery { query, meta } => {
render_shape_query(query);
touch(meta);
}
Expr::Parameter { kind, meta } => {
render_shape_parameter_kind(kind);
touch(meta);
}
Expr::PositionalColumn { index, meta } => {
touch(index);
touch(meta);
}
Expr::SessionVariable { kind, name, meta } => {
render_shape_session_variable_kind(kind);
touch(name);
touch(meta);
}
Expr::Subscript { subscript, meta } => {
render_shape_subscript_expr(subscript);
touch(meta);
}
Expr::SemiStructuredAccess {
semi_structured_access,
meta,
} => {
render_shape_semi_structured_access_expr(semi_structured_access);
touch(meta);
}
Expr::Collate { collate, meta } => {
render_shape_collate_expr(collate);
touch(meta);
}
Expr::Interval { value, unit, meta } => {
render_shape_expr(value);
render_shape_interval_fields(unit);
touch(meta);
}
Expr::AtTimeZone { at_time_zone, meta } => {
render_shape_at_time_zone_expr(at_time_zone);
touch(meta);
}
Expr::Array { array, meta } => {
render_shape_array_expr(array);
touch(meta);
}
Expr::Struct { r#struct, meta } => {
render_shape_struct_expr(r#struct);
touch(meta);
}
Expr::StructConstructor { constructor, meta } => {
render_shape_struct_constructor_expr(constructor);
touch(meta);
}
Expr::Map { map, meta } => {
render_shape_map_expr(map);
touch(meta);
}
Expr::Row { row, meta } => {
render_shape_row_expr(row);
touch(meta);
}
Expr::FieldSelection {
field_selection,
meta,
} => {
render_shape_field_selection_expr(field_selection);
touch(meta);
}
Expr::NamedOperator {
named_operator,
meta,
} => {
render_shape_named_operator_expr(named_operator);
touch(meta);
}
Expr::PrefixOperator {
prefix_operator,
meta,
} => {
render_shape_prefix_operator_expr(prefix_operator);
touch(meta);
}
Expr::PostfixOperator {
postfix_operator,
meta,
} => {
render_shape_postfix_operator_expr(postfix_operator);
touch(meta);
}
Expr::Lambda { lambda, meta } => {
render_shape_lambda_expr(lambda);
touch(meta);
}
Expr::Columns {
qualifier,
pattern,
options,
spelling,
meta,
} => {
if let Some(item) = qualifier.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = pattern.as_ref() {
render_shape_expr(item);
}
if let Some(item) = options.as_ref() {
render_shape_wildcard_options(item);
}
render_shape_columns_spelling(spelling);
touch(meta);
}
Expr::SpecialFunction {
keyword,
precision,
meta,
} => {
render_shape_special_function_keyword(keyword);
touch(precision);
touch(meta);
}
Expr::JsonFunc { json_func, meta } => {
render_shape_json_func_expr(json_func);
touch(meta);
}
Expr::JsonObject { json_object, meta } => {
render_shape_json_object_expr(json_object);
touch(meta);
}
Expr::JsonArray { json_array, meta } => {
render_shape_json_array_expr(json_array);
touch(meta);
}
Expr::JsonAggregate {
json_aggregate,
meta,
} => {
render_shape_json_aggregate_expr(json_aggregate);
touch(meta);
}
Expr::JsonConstructor {
json_constructor,
meta,
} => {
render_shape_json_constructor_expr(json_constructor);
touch(meta);
}
Expr::IsJson { is_json, meta } => {
render_shape_is_json_expr(is_json);
touch(meta);
}
Expr::XmlFunc { xml_func, meta } => {
render_shape_xml_func(xml_func);
touch(meta);
}
Expr::IsDocument {
expr,
negated,
meta,
} => {
render_shape_expr(expr);
touch(negated);
touch(meta);
}
Expr::StringFunc { string_func, meta } => {
render_shape_string_func(string_func);
touch(meta);
}
Expr::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_columns_spelling(node: &ColumnsSpelling) {
match node {
ColumnsSpelling::Columns => {}
ColumnsSpelling::Unpack => {}
ColumnsSpelling::Star => {}
}
}
pub(crate) fn render_shape_special_function_keyword(node: &SpecialFunctionKeyword) {
match node {
SpecialFunctionKeyword::CurrentCatalog => {}
SpecialFunctionKeyword::CurrentDate => {}
SpecialFunctionKeyword::CurrentRole => {}
SpecialFunctionKeyword::CurrentSchema => {}
SpecialFunctionKeyword::CurrentTime => {}
SpecialFunctionKeyword::CurrentTimestamp => {}
SpecialFunctionKeyword::CurrentUser => {}
SpecialFunctionKeyword::LocalTime => {}
SpecialFunctionKeyword::LocalTimestamp => {}
SpecialFunctionKeyword::SessionUser => {}
SpecialFunctionKeyword::SystemUser => {}
SpecialFunctionKeyword::User => {}
SpecialFunctionKeyword::UtcDate => {}
SpecialFunctionKeyword::UtcTime => {}
SpecialFunctionKeyword::UtcTimestamp => {}
}
}
pub(crate) fn render_shape_cast_syntax(node: &CastSyntax) {
match node {
CastSyntax::Call => {}
CastSyntax::DoubleColon => {}
CastSyntax::PrefixTyped => {}
CastSyntax::Convert => {}
}
}
pub(crate) fn render_shape_subscript_expr<X: Extension>(node: &SubscriptExpr<X>) {
let SubscriptExpr {
base,
lower,
upper,
step,
kind,
meta,
} = node;
render_shape_expr(base);
if let Some(item) = lower.as_ref() {
render_shape_expr(item);
}
if let Some(item) = upper.as_ref() {
render_shape_expr(item);
}
if let Some(item) = step.as_ref() {
render_shape_expr(item);
}
render_shape_subscript_kind(kind);
touch(meta);
}
pub(crate) fn render_shape_subscript_kind(node: &SubscriptKind) {
match node {
SubscriptKind::Index => {}
SubscriptKind::Slice => {}
SubscriptKind::SliceWithStep => {}
}
}
pub(crate) fn render_shape_semi_structured_access_expr<X: Extension>(
node: &SemiStructuredAccessExpr<X>,
) {
let SemiStructuredAccessExpr { base, path, meta } = node;
render_shape_expr(base);
for item in path.iter() {
render_shape_semi_structured_path_segment(item);
}
touch(meta);
}
pub(crate) fn render_shape_semi_structured_path_segment<X: Extension>(
node: &SemiStructuredPathSegment<X>,
) {
match node {
SemiStructuredPathSegment::Key { key, meta } => {
render_shape_ident(key);
touch(meta);
}
SemiStructuredPathSegment::Index { index, meta } => {
render_shape_expr(index);
touch(meta);
}
}
}
pub(crate) fn render_shape_collate_expr<X: Extension>(node: &CollateExpr<X>) {
let CollateExpr {
expr,
collation,
meta,
} = node;
render_shape_expr(expr);
render_shape_object_name(collation);
touch(meta);
}
pub(crate) fn render_shape_at_time_zone_expr<X: Extension>(node: &AtTimeZoneExpr<X>) {
let AtTimeZoneExpr { expr, zone, meta } = node;
render_shape_expr(expr);
render_shape_expr(zone);
touch(meta);
}
pub(crate) fn render_shape_array_expr<X: Extension>(node: &ArrayExpr<X>) {
match node {
ArrayExpr::Elements {
elements,
spelling,
meta,
} => {
for item in elements.iter() {
render_shape_expr(item);
}
render_shape_array_spelling(spelling);
touch(meta);
}
ArrayExpr::Subquery { query, meta } => {
render_shape_query(query);
touch(meta);
}
ArrayExpr::Comprehension {
comprehension,
meta,
} => {
render_shape_list_comprehension(comprehension);
touch(meta);
}
}
}
pub(crate) fn render_shape_array_spelling(node: &ArraySpelling) {
match node {
ArraySpelling::Keyword => {}
ArraySpelling::Bracket => {}
}
}
pub(crate) fn render_shape_list_comprehension<X: Extension>(node: &ListComprehension<X>) {
let ListComprehension {
element,
vars,
source,
filter,
meta,
} = node;
render_shape_expr(element);
for item in vars.iter() {
render_shape_ident(item);
}
render_shape_comprehension_source(source);
if let Some(item) = filter.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_comprehension_source<X: Extension>(node: &ComprehensionSource<X>) {
match node {
ComprehensionSource::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
ComprehensionSource::Star {
parenthesized,
options,
meta,
} => {
touch(parenthesized);
if let Some(item) = options.as_ref() {
render_shape_wildcard_options(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_struct_expr<X: Extension>(node: &StructExpr<X>) {
let StructExpr { fields, meta } = node;
for item in fields.iter() {
render_shape_struct_field(item);
}
touch(meta);
}
pub(crate) fn render_shape_struct_field<X: Extension>(node: &StructField<X>) {
let StructField {
key,
key_spelling,
value,
meta,
} = node;
touch(key);
render_shape_struct_key_spelling(key_spelling);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_struct_key_spelling(node: &StructKeySpelling) {
match node {
StructKeySpelling::SingleQuoted => {}
StructKeySpelling::Bare => {}
StructKeySpelling::DoubleQuoted => {}
}
}
pub(crate) fn render_shape_struct_constructor_expr<X: Extension>(node: &StructConstructorExpr<X>) {
let StructConstructorExpr { fields, args, meta } = node;
for item in fields.iter() {
render_shape_struct_constructor_field(item);
}
for item in args.iter() {
render_shape_struct_constructor_arg(item);
}
touch(meta);
}
pub(crate) fn render_shape_struct_constructor_field<X: Extension>(
node: &StructConstructorField<X>,
) {
let StructConstructorField { name, ty, meta } = node;
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
render_shape_data_type(ty);
touch(meta);
}
pub(crate) fn render_shape_struct_constructor_arg<X: Extension>(node: &StructConstructorArg<X>) {
let StructConstructorArg { value, alias, meta } = node;
render_shape_expr(value);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_map_expr<X: Extension>(node: &MapExpr<X>) {
let MapExpr { entries, meta } = node;
for item in entries.iter() {
render_shape_map_entry(item);
}
touch(meta);
}
pub(crate) fn render_shape_map_entry<X: Extension>(node: &MapEntry<X>) {
let MapEntry { key, value, meta } = node;
render_shape_expr(key);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_row_expr<X: Extension>(node: &RowExpr<X>) {
let RowExpr {
fields,
explicit,
meta,
} = node;
for item in fields.iter() {
render_shape_expr(item);
}
touch(explicit);
touch(meta);
}
pub(crate) fn render_shape_field_selection_expr<X: Extension>(node: &FieldSelectionExpr<X>) {
let FieldSelectionExpr {
base,
selector,
meta,
} = node;
render_shape_expr(base);
render_shape_field_selector(selector);
touch(meta);
}
pub(crate) fn render_shape_field_selector(node: &FieldSelector) {
match node {
FieldSelector::Field { field, meta } => {
render_shape_ident(field);
touch(meta);
}
FieldSelector::Star { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_named_operator_expr<X: Extension>(node: &NamedOperatorExpr<X>) {
let NamedOperatorExpr {
left,
schema,
op,
right,
spelling,
meta,
} = node;
render_shape_expr(left);
render_shape_object_name(schema);
touch(op);
render_shape_expr(right);
render_shape_named_operator_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_named_operator_spelling(node: &NamedOperatorSpelling) {
match node {
NamedOperatorSpelling::OperatorKeyword => {}
NamedOperatorSpelling::Bare => {}
}
}
pub(crate) fn render_shape_prefix_operator_expr<X: Extension>(node: &PrefixOperatorExpr<X>) {
let PrefixOperatorExpr { op, operand, meta } = node;
touch(op);
render_shape_expr(operand);
touch(meta);
}
pub(crate) fn render_shape_postfix_operator_expr<X: Extension>(node: &PostfixOperatorExpr<X>) {
let PostfixOperatorExpr { operand, op, meta } = node;
render_shape_expr(operand);
touch(op);
touch(meta);
}
pub(crate) fn render_shape_lambda_expr<X: Extension>(node: &LambdaExpr<X>) {
let LambdaExpr {
params,
spelling,
body,
meta,
} = node;
for item in params.iter() {
render_shape_ident(item);
}
render_shape_lambda_param_spelling(spelling);
render_shape_expr(body);
touch(meta);
}
pub(crate) fn render_shape_lambda_param_spelling(node: &LambdaParamSpelling) {
match node {
LambdaParamSpelling::Bare => {}
LambdaParamSpelling::Parenthesized => {}
LambdaParamSpelling::RowKeyword => {}
LambdaParamSpelling::Keyword => {}
}
}
pub(crate) fn render_shape_parameter_kind(node: &ParameterKind) {
match node {
ParameterKind::Positional(field0) => {
touch(field0);
}
ParameterKind::PositionalLarge { digits } => {
touch(digits);
}
ParameterKind::Numbered(field0) => {
touch(field0);
}
ParameterKind::Anonymous => {}
ParameterKind::Named { name, sigil } => {
touch(name);
render_shape_parameter_sigil(sigil);
}
}
}
pub(crate) fn render_shape_parameter_sigil(node: &ParameterSigil) {
match node {
ParameterSigil::Colon => {}
ParameterSigil::At => {}
ParameterSigil::Dollar => {}
}
}
pub(crate) fn render_shape_session_variable_kind(node: &SessionVariableKind) {
match node {
SessionVariableKind::User => {}
SessionVariableKind::System => {}
SessionVariableKind::SystemGlobal => {}
SessionVariableKind::SystemSession => {}
}
}
pub(crate) fn render_shape_function_call<X: Extension>(node: &FunctionCall<X>) {
let FunctionCall {
name,
quantifier,
args,
wildcard,
order_by,
within_group,
separator,
filter,
filter_where,
over,
null_treatment,
window_tail,
meta,
} = node;
render_shape_object_name(name);
if let Some(item) = quantifier.as_ref() {
render_shape_set_quantifier(item);
}
for item in args.iter() {
render_shape_function_arg(item);
}
touch(wildcard);
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = within_group.as_ref() {
for item1 in item.iter() {
render_shape_order_by_expr(item1);
}
}
if let Some(item) = separator.as_ref() {
render_shape_literal(item);
}
if let Some(item) = filter.as_ref() {
render_shape_expr(item);
}
render_shape_filter_where_spelling(filter_where);
if let Some(item) = over.as_ref() {
render_shape_window_spec(item);
}
if let Some(item) = null_treatment.as_ref() {
render_shape_null_treatment(item);
}
if let Some(item) = window_tail.as_ref() {
render_shape_window_function_tail(item);
}
touch(meta);
}
pub(crate) fn render_shape_function_arg<X: Extension>(node: &FunctionArg<X>) {
let FunctionArg {
name,
variadic,
syntax,
value,
meta,
} = node;
touch(name);
touch(variadic);
render_shape_arg_syntax(syntax);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_arg_syntax(node: &ArgSyntax) {
match node {
ArgSyntax::Positional => {}
ArgSyntax::Arrow => {}
ArgSyntax::ColonEquals => {}
}
}
pub(crate) fn render_shape_null_treatment(node: &NullTreatment) {
match node {
NullTreatment::IgnoreNulls => {}
NullTreatment::RespectNulls => {}
}
}
pub(crate) fn render_shape_window_function_tail(node: &WindowFunctionTail) {
let WindowFunctionTail {
from_first_last,
null_treatment,
} = node;
if let Some(item) = from_first_last.as_ref() {
render_shape_from_first_last(item);
}
if let Some(item) = null_treatment.as_ref() {
render_shape_null_treatment(item);
}
}
pub(crate) fn render_shape_from_first_last(node: &FromFirstLast) {
match node {
FromFirstLast::First => {}
FromFirstLast::Last => {}
}
}
pub(crate) fn render_shape_case_expr<X: Extension>(node: &CaseExpr<X>) {
let CaseExpr {
operand,
when_clauses,
else_result,
meta,
} = node;
if let Some(item) = operand.as_ref() {
render_shape_expr(item);
}
for item in when_clauses.iter() {
render_shape_when_clause(item);
}
if let Some(item) = else_result.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_when_clause<X: Extension>(node: &WhenClause<X>) {
let WhenClause {
condition,
result,
meta,
} = node;
render_shape_expr(condition);
render_shape_expr(result);
touch(meta);
}
pub(crate) fn render_shape_extract_expr<X: Extension>(node: &ExtractExpr<X>) {
let ExtractExpr {
field,
source,
meta,
} = node;
render_shape_ident(field);
render_shape_expr(source);
touch(meta);
}
pub(crate) fn render_shape_json_format(node: &JsonFormat) {
let JsonFormat { encoding } = node;
if let Some(item) = encoding.as_ref() {
render_shape_json_encoding(item);
}
}
pub(crate) fn render_shape_json_encoding(node: &JsonEncoding) {
match node {
JsonEncoding::Utf8 => {}
JsonEncoding::Utf16 => {}
JsonEncoding::Utf32 => {}
}
}
pub(crate) fn render_shape_json_value_expr<X: Extension>(node: &JsonValueExpr<X>) {
let JsonValueExpr { expr, format, meta } = node;
render_shape_expr(expr);
if let Some(item) = format.as_ref() {
render_shape_json_format(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_returning<X: Extension>(node: &JsonReturning<X>) {
let JsonReturning {
data_type,
format,
meta,
} = node;
render_shape_data_type(data_type);
if let Some(item) = format.as_ref() {
render_shape_json_format(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_passing_arg<X: Extension>(node: &JsonPassingArg<X>) {
let JsonPassingArg { value, name, meta } = node;
render_shape_json_value_expr(value);
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_json_behavior<X: Extension>(node: &JsonBehavior<X>) {
let JsonBehavior {
kind,
default_expr,
meta,
} = node;
render_shape_json_behavior_kind(kind);
if let Some(item) = default_expr.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_behavior_kind(node: &JsonBehaviorKind) {
match node {
JsonBehaviorKind::Error => {}
JsonBehaviorKind::Null => {}
JsonBehaviorKind::True => {}
JsonBehaviorKind::False => {}
JsonBehaviorKind::Unknown => {}
JsonBehaviorKind::Empty => {}
JsonBehaviorKind::EmptyArray => {}
JsonBehaviorKind::EmptyObject => {}
JsonBehaviorKind::Default => {}
}
}
pub(crate) fn render_shape_json_wrapper_behavior(node: &JsonWrapperBehavior) {
match node {
JsonWrapperBehavior::Unspecified => {}
JsonWrapperBehavior::Without => {}
JsonWrapperBehavior::Unconditional => {}
JsonWrapperBehavior::Conditional => {}
}
}
pub(crate) fn render_shape_json_quotes_behavior(node: &JsonQuotesBehavior) {
match node {
JsonQuotesBehavior::Unspecified => {}
JsonQuotesBehavior::Keep => {}
JsonQuotesBehavior::Omit => {}
}
}
pub(crate) fn render_shape_json_func_kind(node: &JsonFuncKind) {
match node {
JsonFuncKind::Value => {}
JsonFuncKind::Query => {}
JsonFuncKind::Exists => {}
}
}
pub(crate) fn render_shape_json_func_expr<X: Extension>(node: &JsonFuncExpr<X>) {
let JsonFuncExpr {
kind,
context,
path,
passing,
returning,
wrapper,
quotes,
on_empty,
on_error,
meta,
} = node;
render_shape_json_func_kind(kind);
render_shape_json_value_expr(context);
render_shape_expr(path);
for item in passing.iter() {
render_shape_json_passing_arg(item);
}
if let Some(item) = returning.as_ref() {
render_shape_json_returning(item);
}
render_shape_json_wrapper_behavior(wrapper);
render_shape_json_quotes_behavior(quotes);
if let Some(item) = on_empty.as_ref() {
render_shape_json_behavior(item);
}
if let Some(item) = on_error.as_ref() {
render_shape_json_behavior(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_key_value_spelling(node: &JsonKeyValueSpelling) {
match node {
JsonKeyValueSpelling::Colon => {}
JsonKeyValueSpelling::Value => {}
}
}
pub(crate) fn render_shape_json_key_value<X: Extension>(node: &JsonKeyValue<X>) {
let JsonKeyValue {
key,
value,
spelling,
meta,
} = node;
render_shape_expr(key);
render_shape_json_value_expr(value);
render_shape_json_key_value_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_json_null_clause(node: &JsonNullClause) {
match node {
JsonNullClause::AbsentOnNull => {}
JsonNullClause::NullOnNull => {}
}
}
pub(crate) fn render_shape_json_object_expr<X: Extension>(node: &JsonObjectExpr<X>) {
let JsonObjectExpr {
entries,
null_clause,
unique_keys,
returning,
meta,
} = node;
for item in entries.iter() {
render_shape_json_key_value(item);
}
if let Some(item) = null_clause.as_ref() {
render_shape_json_null_clause(item);
}
touch(unique_keys);
if let Some(item) = returning.as_ref() {
render_shape_json_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_array_body<X: Extension>(node: &JsonArrayBody<X>) {
match node {
JsonArrayBody::Values {
items,
null_clause,
meta,
} => {
for item in items.iter() {
render_shape_json_value_expr(item);
}
if let Some(item) = null_clause.as_ref() {
render_shape_json_null_clause(item);
}
touch(meta);
}
JsonArrayBody::Query {
query,
format,
meta,
} => {
render_shape_query(query);
if let Some(item) = format.as_ref() {
render_shape_json_format(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_json_array_expr<X: Extension>(node: &JsonArrayExpr<X>) {
let JsonArrayExpr {
body,
returning,
meta,
} = node;
render_shape_json_array_body(body);
if let Some(item) = returning.as_ref() {
render_shape_json_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_aggregate_body<X: Extension>(node: &JsonAggregateBody<X>) {
match node {
JsonAggregateBody::Object {
entry,
unique_keys,
meta,
} => {
render_shape_json_key_value(entry);
touch(unique_keys);
touch(meta);
}
JsonAggregateBody::Array {
value,
order_by,
meta,
} => {
render_shape_json_value_expr(value);
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_json_aggregate_expr<X: Extension>(node: &JsonAggregateExpr<X>) {
let JsonAggregateExpr {
body,
null_clause,
returning,
filter,
over,
meta,
} = node;
render_shape_json_aggregate_body(body);
if let Some(item) = null_clause.as_ref() {
render_shape_json_null_clause(item);
}
if let Some(item) = returning.as_ref() {
render_shape_json_returning(item);
}
if let Some(item) = filter.as_ref() {
render_shape_expr(item);
}
if let Some(item) = over.as_ref() {
render_shape_window_spec(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_constructor_kind(node: &JsonConstructorKind) {
match node {
JsonConstructorKind::Json => {}
JsonConstructorKind::Scalar => {}
JsonConstructorKind::Serialize => {}
}
}
pub(crate) fn render_shape_json_constructor_expr<X: Extension>(node: &JsonConstructorExpr<X>) {
let JsonConstructorExpr {
kind,
value,
unique_keys,
returning,
meta,
} = node;
render_shape_json_constructor_kind(kind);
render_shape_json_value_expr(value);
touch(unique_keys);
if let Some(item) = returning.as_ref() {
render_shape_json_returning(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_item_type(node: &JsonItemType) {
match node {
JsonItemType::Any => {}
JsonItemType::Value => {}
JsonItemType::Array => {}
JsonItemType::Object => {}
JsonItemType::Scalar => {}
}
}
pub(crate) fn render_shape_is_json_expr<X: Extension>(node: &IsJsonExpr<X>) {
let IsJsonExpr {
expr,
negated,
item_type,
unique_keys,
meta,
} = node;
render_shape_expr(expr);
touch(negated);
render_shape_json_item_type(item_type);
touch(unique_keys);
touch(meta);
}
pub(crate) fn render_shape_xml_func<X: Extension>(node: &XmlFunc<X>) {
match node {
XmlFunc::Element {
name,
attributes,
content,
meta,
} => {
render_shape_ident(name);
for item in attributes.iter() {
render_shape_xml_attribute(item);
}
for item in content.iter() {
render_shape_expr(item);
}
touch(meta);
}
XmlFunc::Forest { elements, meta } => {
for item in elements.iter() {
render_shape_xml_attribute(item);
}
touch(meta);
}
XmlFunc::Concat { args, meta } => {
for item in args.iter() {
render_shape_expr(item);
}
touch(meta);
}
XmlFunc::Parse {
option,
arg,
whitespace,
meta,
} => {
render_shape_xml_document_or_content(option);
render_shape_expr(arg);
render_shape_xml_whitespace_option(whitespace);
touch(meta);
}
XmlFunc::Pi {
name,
content,
meta,
} => {
render_shape_ident(name);
if let Some(item) = content.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
XmlFunc::Root {
arg,
version,
standalone,
meta,
} => {
render_shape_expr(arg);
if let Some(item) = version.as_ref() {
render_shape_expr(item);
}
render_shape_xml_standalone(standalone);
touch(meta);
}
XmlFunc::Serialize {
option,
arg,
data_type,
indent,
meta,
} => {
render_shape_xml_document_or_content(option);
render_shape_expr(arg);
render_shape_data_type(data_type);
render_shape_xml_indent_option(indent);
touch(meta);
}
XmlFunc::Exists {
path,
mechanism_before,
arg,
mechanism_after,
meta,
} => {
render_shape_expr(path);
if let Some(item) = mechanism_before.as_ref() {
render_shape_xml_passing_mechanism(item);
}
render_shape_expr(arg);
if let Some(item) = mechanism_after.as_ref() {
render_shape_xml_passing_mechanism(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_xml_attribute<X: Extension>(node: &XmlAttribute<X>) {
let XmlAttribute { value, name, meta } = node;
render_shape_expr(value);
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_xml_document_or_content(node: &XmlDocumentOrContent) {
match node {
XmlDocumentOrContent::Document => {}
XmlDocumentOrContent::Content => {}
}
}
pub(crate) fn render_shape_xml_whitespace_option(node: &XmlWhitespaceOption) {
match node {
XmlWhitespaceOption::Unspecified => {}
XmlWhitespaceOption::Preserve => {}
XmlWhitespaceOption::Strip => {}
}
}
pub(crate) fn render_shape_xml_indent_option(node: &XmlIndentOption) {
match node {
XmlIndentOption::Unspecified => {}
XmlIndentOption::Indent => {}
XmlIndentOption::NoIndent => {}
}
}
pub(crate) fn render_shape_xml_standalone(node: &XmlStandalone) {
match node {
XmlStandalone::Unspecified => {}
XmlStandalone::Yes => {}
XmlStandalone::No => {}
XmlStandalone::NoValue => {}
}
}
pub(crate) fn render_shape_xml_passing_mechanism(node: &XmlPassingMechanism) {
match node {
XmlPassingMechanism::ByRef => {}
XmlPassingMechanism::ByValue => {}
}
}
pub(crate) fn render_shape_string_func<X: Extension>(node: &StringFunc<X>) {
match node {
StringFunc::Substring {
expr,
start,
count,
meta,
} => {
render_shape_expr(expr);
if let Some(item) = start.as_ref() {
render_shape_expr(item);
}
if let Some(item) = count.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
StringFunc::SubstringSimilar {
expr,
pattern,
escape,
meta,
} => {
render_shape_expr(expr);
render_shape_expr(pattern);
render_shape_expr(escape);
touch(meta);
}
StringFunc::Position {
substr,
string,
meta,
} => {
render_shape_expr(substr);
render_shape_expr(string);
touch(meta);
}
StringFunc::Overlay {
target,
replacement,
start,
count,
meta,
} => {
render_shape_expr(target);
render_shape_expr(replacement);
render_shape_expr(start);
if let Some(item) = count.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
StringFunc::Trim {
side,
trim_chars,
from,
sources,
meta,
} => {
if let Some(item) = side.as_ref() {
render_shape_trim_side(item);
}
if let Some(item) = trim_chars.as_ref() {
render_shape_expr(item);
}
touch(from);
for item in sources.iter() {
render_shape_expr(item);
}
touch(meta);
}
StringFunc::CollationFor { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
StringFunc::ConvertUsing {
expr,
charset,
meta,
} => {
render_shape_expr(expr);
render_shape_ident(charset);
touch(meta);
}
StringFunc::MatchAgainst {
columns,
against,
modifier,
meta,
} => {
for item in columns.iter() {
render_shape_expr(item);
}
render_shape_expr(against);
if let Some(item) = modifier.as_ref() {
render_shape_match_search_modifier(item);
}
touch(meta);
}
StringFunc::CeilTo {
expr,
field,
spelling,
meta,
} => {
render_shape_expr(expr);
render_shape_ident(field);
render_shape_ceil_spelling(spelling);
touch(meta);
}
StringFunc::FloorTo { expr, field, meta } => {
render_shape_expr(expr);
render_shape_ident(field);
touch(meta);
}
}
}
pub(crate) fn render_shape_match_search_modifier(node: &MatchSearchModifier) {
match node {
MatchSearchModifier::NaturalLanguage => {}
MatchSearchModifier::NaturalLanguageQueryExpansion => {}
MatchSearchModifier::Boolean => {}
MatchSearchModifier::QueryExpansion => {}
}
}
pub(crate) fn render_shape_trim_side(node: &TrimSide) {
match node {
TrimSide::Both => {}
TrimSide::Leading => {}
TrimSide::Trailing => {}
}
}
pub(crate) fn render_shape_quantifier(node: &Quantifier) {
match node {
Quantifier::Any => {}
Quantifier::All => {}
Quantifier::Some => {}
}
}
pub(crate) fn render_shape_binary_operator(node: &BinaryOperator) {
match node {
BinaryOperator::Plus => {}
BinaryOperator::Minus => {}
BinaryOperator::Multiply => {}
BinaryOperator::Divide => {}
BinaryOperator::Modulo(field0) => {
render_shape_modulo_spelling(field0);
}
BinaryOperator::IntegerDivide(field0) => {
render_shape_integer_divide_spelling(field0);
}
BinaryOperator::Exponent => {}
BinaryOperator::StringConcat => {}
BinaryOperator::Contains => {}
BinaryOperator::ContainedBy => {}
BinaryOperator::StartsWith => {}
BinaryOperator::Overlap => {}
BinaryOperator::JsonGet => {}
BinaryOperator::JsonGetText => {}
BinaryOperator::JsonExists => {}
BinaryOperator::JsonExistsAny => {}
BinaryOperator::JsonExistsAll => {}
BinaryOperator::JsonPathExists => {}
BinaryOperator::JsonPathMatch => {}
BinaryOperator::JsonExtractPath => {}
BinaryOperator::JsonExtractPathText => {}
BinaryOperator::JsonDeletePath => {}
BinaryOperator::BitwiseOr => {}
BinaryOperator::BitwiseAnd => {}
BinaryOperator::BitwiseShiftLeft => {}
BinaryOperator::BitwiseShiftRight => {}
BinaryOperator::BitwiseXor(field0) => {
render_shape_bitwise_xor_spelling(field0);
}
BinaryOperator::Eq(field0) => {
render_shape_equals_spelling(field0);
}
BinaryOperator::NotEq(field0) => {
render_shape_not_eq_spelling(field0);
}
BinaryOperator::Lt => {}
BinaryOperator::LtEq => {}
BinaryOperator::Gt => {}
BinaryOperator::GtEq => {}
BinaryOperator::IsDistinctFrom(field0) => {
render_shape_is_distinct_from_spelling(field0);
}
BinaryOperator::IsNotDistinctFrom(field0) => {
render_shape_is_not_distinct_from_spelling(field0);
}
BinaryOperator::Regexp(field0) => {
render_shape_regexp_spelling(field0);
}
BinaryOperator::Glob => {}
BinaryOperator::Match => {}
BinaryOperator::Overlaps => {}
BinaryOperator::And => {}
BinaryOperator::Xor => {}
BinaryOperator::Or => {}
}
}
pub(crate) fn render_shape_modulo_spelling(node: &ModuloSpelling) {
match node {
ModuloSpelling::Percent => {}
ModuloSpelling::Mod => {}
}
}
pub(crate) fn render_shape_integer_divide_spelling(node: &IntegerDivideSpelling) {
match node {
IntegerDivideSpelling::Div => {}
IntegerDivideSpelling::SlashSlash => {}
}
}
pub(crate) fn render_shape_equals_spelling(node: &EqualsSpelling) {
match node {
EqualsSpelling::Single => {}
EqualsSpelling::Double => {}
}
}
pub(crate) fn render_shape_filter_where_spelling(node: &FilterWhereSpelling) {
match node {
FilterWhereSpelling::Where => {}
FilterWhereSpelling::Omitted => {}
}
}
pub(crate) fn render_shape_not_eq_spelling(node: &NotEqSpelling) {
match node {
NotEqSpelling::AngleBracket => {}
NotEqSpelling::Bang => {}
}
}
pub(crate) fn render_shape_is_distinct_from_spelling(node: &IsDistinctFromSpelling) {
match node {
IsDistinctFromSpelling::Keyword => {}
IsDistinctFromSpelling::Is => {}
}
}
pub(crate) fn render_shape_is_not_distinct_from_spelling(node: &IsNotDistinctFromSpelling) {
match node {
IsNotDistinctFromSpelling::Keyword => {}
IsNotDistinctFromSpelling::NullSafeEq => {}
IsNotDistinctFromSpelling::Is => {}
}
}
pub(crate) fn render_shape_truth_value(node: &TruthValue) {
match node {
TruthValue::True => {}
TruthValue::False => {}
TruthValue::Unknown => {}
}
}
pub(crate) fn render_shape_bitwise_xor_spelling(node: &BitwiseXorSpelling) {
match node {
BitwiseXorSpelling::Hash => {}
BitwiseXorSpelling::Caret => {}
}
}
pub(crate) fn render_shape_regexp_spelling(node: &RegexpSpelling) {
match node {
RegexpSpelling::Rlike => {}
RegexpSpelling::Regexp => {}
}
}
pub(crate) fn render_shape_like_spelling(node: &LikeSpelling) {
match node {
LikeSpelling::Like => {}
LikeSpelling::ILike => {}
LikeSpelling::SimilarTo => {}
}
}
pub(crate) fn render_shape_null_test_spelling(node: &NullTestSpelling) {
match node {
NullTestSpelling::Is => {}
NullTestSpelling::Postfix => {}
NullTestSpelling::PostfixNotNull => {}
}
}
pub(crate) fn render_shape_ceil_spelling(node: &CeilSpelling) {
match node {
CeilSpelling::Ceil => {}
CeilSpelling::Ceiling => {}
}
}
pub(crate) fn render_shape_normalization_form(node: &NormalizationForm) {
match node {
NormalizationForm::Nfc => {}
NormalizationForm::Nfd => {}
NormalizationForm::Nfkc => {}
NormalizationForm::Nfkd => {}
}
}
pub(crate) fn render_shape_unary_operator(node: &UnaryOperator) {
match node {
UnaryOperator::Not => {}
UnaryOperator::Minus => {}
UnaryOperator::Plus => {}
UnaryOperator::BitwiseNot => {}
UnaryOperator::Prior => {}
}
}
pub(crate) fn render_shape_no_ext(node: &NoExt) {
match *node {}
}
pub(crate) fn render_shape_ident(node: &Ident) {
let Ident { sym, quote, meta } = node;
touch(sym);
render_shape_quote_style(quote);
touch(meta);
}
pub(crate) fn render_shape_quote_style(node: &QuoteStyle) {
match node {
QuoteStyle::None => {}
QuoteStyle::Single => {}
QuoteStyle::Double => {}
QuoteStyle::UnicodeDouble => {}
QuoteStyle::Backtick => {}
QuoteStyle::Bracket => {}
}
}
pub(crate) fn render_shape_object_name(node: &ObjectName) {
let ObjectName(field0) = node;
for item in field0.iter() {
render_shape_ident(item);
}
}
pub(crate) fn render_shape_literal(node: &Literal) {
let Literal { kind, meta } = node;
render_shape_literal_kind(kind);
touch(meta);
}
pub(crate) fn render_shape_literal_kind(node: &LiteralKind) {
match node {
LiteralKind::Integer => {}
LiteralKind::Float => {}
LiteralKind::Decimal => {}
LiteralKind::String => {}
LiteralKind::Boolean(field0) => {
touch(field0);
}
LiteralKind::Null => {}
LiteralKind::Date => {}
LiteralKind::Time { time_zone } => {
render_shape_time_zone(time_zone);
}
LiteralKind::Timestamp { time_zone } => {
render_shape_time_zone(time_zone);
}
LiteralKind::Interval { fields, precision } => {
if let Some(item) = fields.as_ref() {
render_shape_interval_fields(item);
}
touch(precision);
}
LiteralKind::BitString { radix } => {
render_shape_bit_string_radix(radix);
}
LiteralKind::Money => {}
}
}
pub(crate) fn render_shape_bit_string_radix(node: &BitStringRadix) {
match node {
BitStringRadix::Binary => {}
BitStringRadix::Hex => {}
}
}
pub(crate) fn render_shape_match_recognize<X: Extension>(node: &MatchRecognize<X>) {
let MatchRecognize {
source,
partition_by,
order_by,
measures,
rows_per_match,
after_match_skip,
pattern,
subsets,
define,
meta,
} = node;
render_shape_table_factor(source);
for item in partition_by.iter() {
render_shape_expr(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
for item in measures.iter() {
render_shape_measure(item);
}
if let Some(item) = rows_per_match.as_ref() {
render_shape_rows_per_match(item);
}
if let Some(item) = after_match_skip.as_ref() {
render_shape_after_match_skip(item);
}
render_shape_match_recognize_pattern(pattern);
for item in subsets.iter() {
render_shape_subset_definition(item);
}
for item in define.iter() {
render_shape_symbol_definition(item);
}
touch(meta);
}
pub(crate) fn render_shape_measure<X: Extension>(node: &Measure<X>) {
let Measure { expr, alias, meta } = node;
render_shape_expr(expr);
render_shape_ident(alias);
touch(meta);
}
pub(crate) fn render_shape_rows_per_match(node: &RowsPerMatch) {
match node {
RowsPerMatch::OneRow => {}
RowsPerMatch::AllRows(field0) => {
if let Some(item) = field0.as_ref() {
render_shape_empty_matches_mode(item);
}
}
}
}
pub(crate) fn render_shape_empty_matches_mode(node: &EmptyMatchesMode) {
match node {
EmptyMatchesMode::Show => {}
EmptyMatchesMode::Omit => {}
EmptyMatchesMode::WithUnmatched => {}
}
}
pub(crate) fn render_shape_after_match_skip(node: &AfterMatchSkip) {
match node {
AfterMatchSkip::PastLastRow { meta } => {
touch(meta);
}
AfterMatchSkip::ToNextRow { meta } => {
touch(meta);
}
AfterMatchSkip::ToFirst { symbol, meta } => {
render_shape_ident(symbol);
touch(meta);
}
AfterMatchSkip::ToLast { symbol, meta } => {
render_shape_ident(symbol);
touch(meta);
}
}
}
pub(crate) fn render_shape_subset_definition(node: &SubsetDefinition) {
let SubsetDefinition {
name,
members,
meta,
} = node;
render_shape_ident(name);
for item in members.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_symbol_definition<X: Extension>(node: &SymbolDefinition<X>) {
let SymbolDefinition {
symbol,
definition,
meta,
} = node;
render_shape_ident(symbol);
render_shape_expr(definition);
touch(meta);
}
pub(crate) fn render_shape_match_recognize_pattern(node: &MatchRecognizePattern) {
match node {
MatchRecognizePattern::Symbol { symbol, meta } => {
render_shape_ident(symbol);
touch(meta);
}
MatchRecognizePattern::Start { meta } => {
touch(meta);
}
MatchRecognizePattern::End { meta } => {
touch(meta);
}
MatchRecognizePattern::Concat { patterns, meta } => {
for item in patterns.iter() {
render_shape_match_recognize_pattern(item);
}
touch(meta);
}
MatchRecognizePattern::Alternation { patterns, meta } => {
for item in patterns.iter() {
render_shape_match_recognize_pattern(item);
}
touch(meta);
}
MatchRecognizePattern::Group { pattern, meta } => {
render_shape_match_recognize_pattern(pattern);
touch(meta);
}
MatchRecognizePattern::Exclude { pattern, meta } => {
render_shape_match_recognize_pattern(pattern);
touch(meta);
}
MatchRecognizePattern::Permute { patterns, meta } => {
for item in patterns.iter() {
render_shape_match_recognize_pattern(item);
}
touch(meta);
}
MatchRecognizePattern::Repetition {
pattern,
quantifier,
meta,
} => {
render_shape_match_recognize_pattern(pattern);
render_shape_repetition_quantifier(quantifier);
touch(meta);
}
}
}
pub(crate) fn render_shape_repetition_quantifier(node: &RepetitionQuantifier) {
match node {
RepetitionQuantifier::ZeroOrMore => {}
RepetitionQuantifier::OneOrMore => {}
RepetitionQuantifier::AtMostOne => {}
RepetitionQuantifier::Exactly(field0) => {
touch(field0);
}
RepetitionQuantifier::AtLeast(field0) => {
touch(field0);
}
RepetitionQuantifier::AtMost(field0) => {
touch(field0);
}
RepetitionQuantifier::Range(field0, field1) => {
touch(field0);
touch(field1);
}
}
}
pub(crate) fn render_shape_pipe_operator<X: Extension>(node: &PipeOperator<X>) {
match node {
PipeOperator::Where { predicate, meta } => {
render_shape_expr(predicate);
touch(meta);
}
PipeOperator::Select { items, meta } => {
for item in items.iter() {
render_shape_select_item(item);
}
touch(meta);
}
PipeOperator::Extend { items, meta } => {
for item in items.iter() {
render_shape_select_item(item);
}
touch(meta);
}
PipeOperator::As { alias, meta } => {
render_shape_table_alias(alias);
touch(meta);
}
PipeOperator::OrderBy { keys, meta } => {
for item in keys.iter() {
render_shape_order_by_expr(item);
}
touch(meta);
}
PipeOperator::Limit {
count,
offset,
meta,
} => {
render_shape_expr(count);
if let Some(item) = offset.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
PipeOperator::Join { join, meta } => {
render_shape_join(join);
touch(meta);
}
PipeOperator::SetOperation {
op,
quantifier,
queries,
meta,
} => {
render_shape_set_operator(op);
if let Some(item) = quantifier.as_ref() {
render_shape_set_quantifier(item);
}
for item in queries.iter() {
render_shape_query(item);
}
touch(meta);
}
PipeOperator::Set { assignments, meta } => {
for item in assignments.iter() {
render_shape_update_assignment(item);
}
touch(meta);
}
PipeOperator::Call { call, alias, meta } => {
render_shape_function_call(call);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
PipeOperator::Aggregate {
aggregates,
group_by,
meta,
} => {
for item in aggregates.iter() {
render_shape_pipe_aggregate_expr(item);
}
for item in group_by.iter() {
render_shape_pipe_aggregate_expr(item);
}
touch(meta);
}
PipeOperator::Drop { columns, meta } => {
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
PipeOperator::Rename { renames, meta } => {
for item in renames.iter() {
render_shape_pipe_rename_item(item);
}
touch(meta);
}
PipeOperator::Pivot {
aggregates,
column,
meta,
} => {
for item in aggregates.iter() {
render_shape_pivot_expr(item);
}
render_shape_pivot_column(column);
touch(meta);
}
PipeOperator::Unpivot {
value,
name,
columns,
meta,
} => {
for item in value.iter() {
render_shape_ident(item);
}
for item in name.iter() {
render_shape_ident(item);
}
for item in columns.iter() {
render_shape_unpivot_column(item);
}
touch(meta);
}
PipeOperator::TableSample { sample, meta } => {
render_shape_table_sample(sample);
touch(meta);
}
}
}
pub(crate) fn render_shape_pipe_aggregate_expr<X: Extension>(node: &PipeAggregateExpr<X>) {
let PipeAggregateExpr {
expr,
alias,
asc,
nulls_first,
meta,
} = node;
render_shape_expr(expr);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
touch(asc);
touch(nulls_first);
touch(meta);
}
pub(crate) fn render_shape_pipe_rename_item(node: &PipeRenameItem) {
let PipeRenameItem { old, new, meta } = node;
render_shape_ident(old);
render_shape_ident(new);
touch(meta);
}
pub(crate) fn render_shape_pivot<X: Extension>(node: &Pivot<X>) {
let Pivot {
source,
aggregates,
pivot_on,
group_by,
with,
order_by,
order_by_all,
limit,
default_on_null,
spelling,
meta,
} = node;
render_shape_table_factor(source);
for item in aggregates.iter() {
render_shape_pivot_expr(item);
}
for item in pivot_on.iter() {
render_shape_pivot_column(item);
}
for item in group_by.iter() {
render_shape_expr(item);
}
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = order_by_all.as_ref() {
render_shape_order_by_all(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
if let Some(item) = default_on_null.as_ref() {
render_shape_expr(item);
}
render_shape_pivot_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_unpivot<X: Extension>(node: &Unpivot<X>) {
let Unpivot {
source,
value,
name,
columns,
null_inclusion,
with,
order_by,
order_by_all,
limit,
spelling,
meta,
} = node;
render_shape_table_factor(source);
for item in value.iter() {
render_shape_ident(item);
}
for item in name.iter() {
render_shape_ident(item);
}
for item in columns.iter() {
render_shape_unpivot_column(item);
}
if let Some(item) = null_inclusion.as_ref() {
render_shape_null_inclusion(item);
}
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = order_by_all.as_ref() {
render_shape_order_by_all(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
render_shape_unpivot_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_null_inclusion(node: &NullInclusion) {
match node {
NullInclusion::IncludeNulls => {}
NullInclusion::ExcludeNulls => {}
}
}
pub(crate) fn render_shape_pivot_expr<X: Extension>(node: &PivotExpr<X>) {
let PivotExpr {
expr,
alias,
alias_spelling,
meta,
} = node;
render_shape_expr(expr);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
pub(crate) fn render_shape_pivot_column<X: Extension>(node: &PivotColumn<X>) {
let PivotColumn {
expr,
values,
enum_source,
value_source,
meta,
} = node;
render_shape_expr(expr);
for item in values.iter() {
render_shape_pivot_expr(item);
}
if let Some(item) = enum_source.as_ref() {
render_shape_ident(item);
}
if let Some(item) = value_source.as_ref() {
render_shape_pivot_value_source(item);
}
touch(meta);
}
pub(crate) fn render_shape_pivot_value_source<X: Extension>(node: &PivotValueSource<X>) {
match node {
PivotValueSource::Any { order_by, meta } => {
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
touch(meta);
}
PivotValueSource::Subquery { query, meta } => {
render_shape_query(query);
touch(meta);
}
}
}
pub(crate) fn render_shape_unpivot_column<X: Extension>(node: &UnpivotColumn<X>) {
let UnpivotColumn {
columns,
alias,
alias_spelling,
meta,
} = node;
for item in columns.iter() {
render_shape_expr(item);
}
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
pub(crate) fn render_shape_pivot_spelling(node: &PivotSpelling) {
match node {
PivotSpelling::Statement => {}
PivotSpelling::TableFactor => {}
}
}
pub(crate) fn render_shape_unpivot_spelling(node: &UnpivotSpelling) {
match node {
UnpivotSpelling::Statement => {}
UnpivotSpelling::TableFactor => {}
}
}
pub(crate) fn render_shape_query<X: Extension>(node: &Query<X>) {
let Query {
with,
body,
order_by,
order_by_all,
limit_by,
limit,
settings,
format,
locking,
pipe_operators,
for_clause,
meta,
} = node;
if let Some(item) = with.as_ref() {
render_shape_with(item);
}
render_shape_set_expr(body);
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = order_by_all.as_ref() {
render_shape_order_by_all(item);
}
if let Some(item) = limit_by.as_ref() {
render_shape_limit_by(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
for item in settings.iter() {
render_shape_setting(item);
}
if let Some(item) = format.as_ref() {
render_shape_format_clause(item);
}
for item in locking.iter() {
render_shape_locking_clause(item);
}
for item in pipe_operators.iter() {
render_shape_pipe_operator(item);
}
if let Some(item) = for_clause.as_ref() {
render_shape_for_clause(item);
}
touch(meta);
}
pub(crate) fn render_shape_locking_clause(node: &LockingClause) {
let LockingClause {
strength,
of,
wait,
spelling,
meta,
} = node;
render_shape_lock_strength(strength);
for item in of.iter() {
render_shape_object_name(item);
}
if let Some(item) = wait.as_ref() {
render_shape_lock_wait(item);
}
render_shape_locking_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_lock_strength(node: &LockStrength) {
match node {
LockStrength::Update => {}
LockStrength::NoKeyUpdate => {}
LockStrength::Share => {}
LockStrength::KeyShare => {}
}
}
pub(crate) fn render_shape_lock_wait(node: &LockWait) {
match node {
LockWait::NoWait => {}
LockWait::SkipLocked => {}
}
}
pub(crate) fn render_shape_locking_spelling(node: &LockingSpelling) {
match node {
LockingSpelling::Modern => {}
LockingSpelling::LockInShareMode => {}
}
}
pub(crate) fn render_shape_set_expr<X: Extension>(node: &SetExpr<X>) {
match node {
SetExpr::Select { select, meta } => {
render_shape_select(select);
touch(meta);
}
SetExpr::Values { values, meta } => {
render_shape_values(values);
touch(meta);
}
SetExpr::Query { query, meta } => {
render_shape_query(query);
touch(meta);
}
SetExpr::SetOperation {
op,
all,
by_name,
left,
right,
meta,
} => {
render_shape_set_operator(op);
touch(all);
touch(by_name);
render_shape_set_expr(left);
render_shape_set_expr(right);
touch(meta);
}
SetExpr::Pivot { pivot, meta } => {
render_shape_pivot(pivot);
touch(meta);
}
SetExpr::Unpivot { unpivot, meta } => {
render_shape_unpivot(unpivot);
touch(meta);
}
}
}
pub(crate) fn render_shape_set_operator(node: &SetOperator) {
match node {
SetOperator::Union => {}
SetOperator::Intersect => {}
SetOperator::Except => {}
}
}
pub(crate) fn render_shape_with<X: Extension>(node: &With<X>) {
let With {
recursive,
ctes,
meta,
} = node;
touch(recursive);
for item in ctes.iter() {
render_shape_cte(item);
}
touch(meta);
}
pub(crate) fn render_shape_cte<X: Extension>(node: &Cte<X>) {
let Cte {
name,
columns,
using_key,
materialized,
body,
search,
cycle,
meta,
} = node;
render_shape_ident(name);
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = using_key.as_ref() {
for item1 in item.iter() {
render_shape_ident(item1);
}
}
touch(materialized);
render_shape_cte_body(body);
if let Some(item) = search.as_ref() {
render_shape_cte_search_clause(item);
}
if let Some(item) = cycle.as_ref() {
render_shape_cte_cycle_clause(item);
}
touch(meta);
}
pub(crate) fn render_shape_cte_search_clause(node: &CteSearchClause) {
let CteSearchClause {
breadth_first,
columns,
set_column,
meta,
} = node;
touch(breadth_first);
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_ident(set_column);
touch(meta);
}
pub(crate) fn render_shape_cte_cycle_clause<X: Extension>(node: &CteCycleClause<X>) {
let CteCycleClause {
columns,
mark_column,
mark,
path_column,
meta,
} = node;
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_ident(mark_column);
if let Some(item) = mark.as_ref() {
render_shape_cte_cycle_mark(item);
}
render_shape_ident(path_column);
touch(meta);
}
pub(crate) fn render_shape_cte_cycle_mark<X: Extension>(node: &CteCycleMark<X>) {
let CteCycleMark {
value,
default,
meta,
} = node;
render_shape_expr(value);
render_shape_expr(default);
touch(meta);
}
pub(crate) fn render_shape_cte_body<X: Extension>(node: &CteBody<X>) {
match node {
CteBody::Query { query, meta } => {
render_shape_query(query);
touch(meta);
}
CteBody::Insert { insert, meta } => {
render_shape_insert(insert);
touch(meta);
}
CteBody::Update { update, meta } => {
render_shape_update(update);
touch(meta);
}
CteBody::Delete { delete, meta } => {
render_shape_delete(delete);
touch(meta);
}
CteBody::Merge { merge, meta } => {
render_shape_merge(merge);
touch(meta);
}
}
}
pub(crate) fn render_shape_values<X: Extension>(node: &Values<X>) {
let Values {
explicit_row,
rows,
meta,
} = node;
touch(explicit_row);
for item in rows.iter() {
for item1 in item.iter() {
render_shape_values_item(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_values_item<X: Extension>(node: &ValuesItem<X>) {
match node {
ValuesItem::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
ValuesItem::Default { default, meta } => {
render_shape_default_value(default);
touch(meta);
}
}
}
pub(crate) fn render_shape_select<X: Extension>(node: &Select<X>) {
let Select {
distinct,
straight_join,
projection,
into,
from,
lateral_views,
selection,
connect_by,
group_by,
group_by_quantifier,
group_by_all,
having,
windows,
qualify,
sample,
spelling,
meta,
} = node;
if let Some(item) = distinct.as_ref() {
render_shape_select_distinct(item);
}
touch(straight_join);
for item in projection.iter() {
render_shape_select_item(item);
}
if let Some(item) = into.as_ref() {
render_shape_into_target(item);
}
for item in from.iter() {
render_shape_table_with_joins(item);
}
for item in lateral_views.iter() {
render_shape_lateral_view(item);
}
if let Some(item) = selection.as_ref() {
render_shape_expr(item);
}
if let Some(item) = connect_by.as_ref() {
render_shape_hierarchical_clause(item);
}
for item in group_by.iter() {
render_shape_group_by_item(item);
}
if let Some(item) = group_by_quantifier.as_ref() {
render_shape_set_quantifier(item);
}
if let Some(item) = group_by_all.as_ref() {
render_shape_group_by_all_spelling(item);
}
if let Some(item) = having.as_ref() {
render_shape_expr(item);
}
for item in windows.iter() {
render_shape_named_window(item);
}
if let Some(item) = qualify.as_ref() {
render_shape_expr(item);
}
if let Some(item) = sample.as_ref() {
render_shape_sample_clause(item);
}
render_shape_select_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_select_spelling(node: &SelectSpelling) {
match node {
SelectSpelling::Select => {}
SelectSpelling::TableCommand => {}
SelectSpelling::FromFirst => {}
}
}
pub(crate) fn render_shape_group_by_all_spelling(node: &GroupByAllSpelling) {
match node {
GroupByAllSpelling::Keyword => {}
GroupByAllSpelling::Star => {}
}
}
pub(crate) fn render_shape_into_target(node: &IntoTarget) {
let IntoTarget {
temporary,
name,
meta,
} = node;
if let Some(item) = temporary.as_ref() {
render_shape_temporary_table_kind(item);
}
render_shape_object_name(name);
touch(meta);
}
pub(crate) fn render_shape_group_by_item<X: Extension>(node: &GroupByItem<X>) {
match node {
GroupByItem::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
GroupByItem::Rollup {
exprs,
spelling,
meta,
} => {
for item in exprs.iter() {
render_shape_expr(item);
}
render_shape_rollup_spelling(spelling);
touch(meta);
}
GroupByItem::Cube { exprs, meta } => {
for item in exprs.iter() {
render_shape_expr(item);
}
touch(meta);
}
GroupByItem::GroupingSets { sets, meta } => {
for item in sets.iter() {
render_shape_group_by_item(item);
}
touch(meta);
}
GroupByItem::Empty { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_rollup_spelling(node: &RollupSpelling) {
match node {
RollupSpelling::Function => {}
RollupSpelling::WithRollup => {}
}
}
pub(crate) fn render_shape_alias_spelling(node: &AliasSpelling) {
match node {
AliasSpelling::Bare => {}
AliasSpelling::As => {}
AliasSpelling::PrefixColon => {}
}
}
pub(crate) fn render_shape_select_item<X: Extension>(node: &SelectItem<X>) {
match node {
SelectItem::Wildcard {
options,
alias,
alias_spelling,
meta,
} => {
if let Some(item) = options.as_ref() {
render_shape_wildcard_options(item);
}
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
SelectItem::QualifiedWildcard {
name,
options,
alias,
alias_spelling,
meta,
} => {
render_shape_object_name(name);
if let Some(item) = options.as_ref() {
render_shape_wildcard_options(item);
}
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
SelectItem::Expr {
expr,
alias,
alias_spelling,
meta,
} => {
render_shape_expr(expr);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_alias_spelling(alias_spelling);
touch(meta);
}
}
}
pub(crate) fn render_shape_wildcard_options<X: Extension>(node: &WildcardOptions<X>) {
let WildcardOptions {
exclude,
replace,
rename,
meta,
} = node;
for item in exclude.iter() {
render_shape_object_name(item);
}
for item in replace.iter() {
render_shape_wildcard_replace(item);
}
for item in rename.iter() {
render_shape_wildcard_rename(item);
}
touch(meta);
}
pub(crate) fn render_shape_wildcard_replace<X: Extension>(node: &WildcardReplace<X>) {
let WildcardReplace { expr, column, meta } = node;
render_shape_expr(expr);
render_shape_ident(column);
touch(meta);
}
pub(crate) fn render_shape_wildcard_rename(node: &WildcardRename) {
let WildcardRename {
column,
alias,
meta,
} = node;
render_shape_object_name(column);
render_shape_ident(alias);
touch(meta);
}
pub(crate) fn render_shape_set_quantifier(node: &SetQuantifier) {
match node {
SetQuantifier::All => {}
SetQuantifier::Distinct => {}
}
}
pub(crate) fn render_shape_select_distinct<X: Extension>(node: &SelectDistinct<X>) {
match node {
SelectDistinct::Quantifier { quantifier, meta } => {
render_shape_set_quantifier(quantifier);
touch(meta);
}
SelectDistinct::On { exprs, meta } => {
for item in exprs.iter() {
render_shape_expr(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_table_with_joins<X: Extension>(node: &TableWithJoins<X>) {
let TableWithJoins {
relation,
joins,
meta,
} = node;
render_shape_table_factor(relation);
for item in joins.iter() {
render_shape_join(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_alias(node: &TableAlias) {
let TableAlias {
name,
columns,
spelling,
meta,
} = node;
render_shape_ident(name);
for item in columns.iter() {
render_shape_ident(item);
}
render_shape_alias_spelling(spelling);
touch(meta);
}
pub(crate) fn render_shape_only_syntax(node: &OnlySyntax) {
match node {
OnlySyntax::Bare => {}
OnlySyntax::Parenthesized => {}
}
}
pub(crate) fn render_shape_relation_inheritance(node: &RelationInheritance) {
match node {
RelationInheritance::Plain => {}
RelationInheritance::Descendants => {}
RelationInheritance::Only(field0) => {
render_shape_only_syntax(field0);
}
}
}
pub(crate) fn render_shape_table_sample<X: Extension>(node: &TableSample<X>) {
let TableSample {
method,
args,
repeatable,
meta,
} = node;
render_shape_object_name(method);
for item in args.iter() {
render_shape_expr(item);
}
if let Some(item) = repeatable.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_version<X: Extension>(node: &TableVersion<X>) {
match node {
TableVersion::ForSystemTimeAsOf { point, meta } => {
render_shape_expr(point);
touch(meta);
}
TableVersion::ForSystemTimeFromTo { start, end, meta } => {
render_shape_expr(start);
render_shape_expr(end);
touch(meta);
}
TableVersion::ForSystemTimeBetween { start, end, meta } => {
render_shape_expr(start);
render_shape_expr(end);
touch(meta);
}
TableVersion::ForSystemTimeContainedIn { start, end, meta } => {
render_shape_expr(start);
render_shape_expr(end);
touch(meta);
}
TableVersion::ForSystemTimeAll { meta } => {
touch(meta);
}
TableVersion::VersionAsOf { version, meta } => {
render_shape_expr(version);
touch(meta);
}
TableVersion::TimestampAsOf { point, meta } => {
render_shape_expr(point);
touch(meta);
}
}
}
pub(crate) fn render_shape_sample_clause(node: &SampleClause) {
let SampleClause {
method,
size,
unit,
seed,
meta,
} = node;
if let Some(item) = method.as_ref() {
render_shape_object_name(item);
}
render_shape_literal(size);
render_shape_sample_unit(unit);
if let Some(item) = seed.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_sample_unit(node: &SampleUnit) {
match node {
SampleUnit::Count => {}
SampleUnit::Rows => {}
SampleUnit::Percent => {}
SampleUnit::PercentSign => {}
}
}
pub(crate) fn render_shape_table_function_column<X: Extension>(node: &TableFunctionColumn<X>) {
let TableFunctionColumn {
name,
data_type,
meta,
} = node;
render_shape_ident(name);
render_shape_data_type(data_type);
touch(meta);
}
pub(crate) fn render_shape_rows_from_item<X: Extension>(node: &RowsFromItem<X>) {
let RowsFromItem {
function,
column_defs,
meta,
} = node;
render_shape_function_call(function);
for item in column_defs.iter() {
render_shape_table_function_column(item);
}
touch(meta);
}
pub(crate) fn render_shape_index_hint(node: &IndexHint) {
let IndexHint {
action,
keyword,
scope,
indexes,
meta,
} = node;
render_shape_index_hint_action(action);
render_shape_index_hint_keyword(keyword);
if let Some(item) = scope.as_ref() {
render_shape_index_hint_scope(item);
}
for item in indexes.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_index_hint_action(node: &IndexHintAction) {
match node {
IndexHintAction::Use => {}
IndexHintAction::Ignore => {}
IndexHintAction::Force => {}
}
}
pub(crate) fn render_shape_index_hint_keyword(node: &IndexHintKeyword) {
match node {
IndexHintKeyword::Index => {}
IndexHintKeyword::Key => {}
}
}
pub(crate) fn render_shape_index_hint_scope(node: &IndexHintScope) {
match node {
IndexHintScope::Join => {}
IndexHintScope::OrderBy => {}
IndexHintScope::GroupBy => {}
}
}
pub(crate) fn render_shape_indexed_by(node: &IndexedBy) {
match node {
IndexedBy::Named { index, meta } => {
render_shape_ident(index);
touch(meta);
}
IndexedBy::NotIndexed { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_table_hint(node: &TableHint) {
match node {
TableHint::Keyword { keyword, meta } => {
render_shape_table_hint_keyword(keyword);
touch(meta);
}
TableHint::Index {
equals,
indexes,
meta,
} => {
touch(equals);
for item in indexes.iter() {
render_shape_ident(item);
}
touch(meta);
}
TableHint::ForceSeek { target, meta } => {
if let Some(item) = target.as_ref() {
render_shape_force_seek_target(item);
}
touch(meta);
}
TableHint::Other { ident, meta } => {
render_shape_ident(ident);
touch(meta);
}
}
}
pub(crate) fn render_shape_force_seek_target(node: &ForceSeekTarget) {
let ForceSeekTarget {
index,
columns,
meta,
} = node;
render_shape_ident(index);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_hint_keyword(node: &TableHintKeyword) {
match node {
TableHintKeyword::NoLock => {}
TableHintKeyword::HoldLock => {}
TableHintKeyword::UpdLock => {}
TableHintKeyword::XLock => {}
TableHintKeyword::RowLock => {}
TableHintKeyword::PagLock => {}
TableHintKeyword::TabLock => {}
TableHintKeyword::TabLockX => {}
TableHintKeyword::ReadPast => {}
TableHintKeyword::ReadUncommitted => {}
TableHintKeyword::ReadCommitted => {}
TableHintKeyword::ReadCommittedLock => {}
TableHintKeyword::RepeatableRead => {}
TableHintKeyword::Serializable => {}
TableHintKeyword::Snapshot => {}
TableHintKeyword::NoWait => {}
TableHintKeyword::NoExpand => {}
TableHintKeyword::ForceScan => {}
TableHintKeyword::KeepIdentity => {}
TableHintKeyword::KeepDefaults => {}
TableHintKeyword::IgnoreConstraints => {}
TableHintKeyword::IgnoreTriggers => {}
}
}
pub(crate) fn render_shape_derived_spelling(node: &DerivedSpelling) {
match node {
DerivedSpelling::Parenthesized => {}
DerivedSpelling::BareValues => {}
}
}
pub(crate) fn render_shape_table_factor<X: Extension>(node: &TableFactor<X>) {
match node {
TableFactor::Table {
name,
inheritance,
json_path,
version,
partition,
alias,
indexed_by,
index_hints,
sample,
table_hints,
meta,
} => {
render_shape_object_name(name);
render_shape_relation_inheritance(inheritance);
for item in json_path.iter() {
render_shape_semi_structured_path_segment(item);
}
if let Some(item) = version.as_ref() {
render_shape_table_version(item);
}
for item in partition.iter() {
render_shape_ident(item);
}
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
if let Some(item) = indexed_by.as_ref() {
render_shape_indexed_by(item);
}
for item in index_hints.iter() {
render_shape_index_hint(item);
}
if let Some(item) = sample.as_ref() {
render_shape_table_sample(item);
}
for item in table_hints.iter() {
render_shape_table_hint(item);
}
touch(meta);
}
TableFactor::Derived {
lateral,
subquery,
alias,
spelling,
meta,
} => {
touch(lateral);
render_shape_query(subquery);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
render_shape_derived_spelling(spelling);
touch(meta);
}
TableFactor::Function {
lateral,
function,
with_ordinality,
alias,
column_defs,
meta,
} => {
touch(lateral);
render_shape_function_call(function);
touch(with_ordinality);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
for item in column_defs.iter() {
render_shape_table_function_column(item);
}
touch(meta);
}
TableFactor::RowsFrom {
lateral,
functions,
with_ordinality,
alias,
meta,
} => {
touch(lateral);
for item in functions.iter() {
render_shape_rows_from_item(item);
}
touch(with_ordinality);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::Unnest {
lateral,
array_exprs,
with_ordinality,
alias,
column_defs,
with_offset,
with_offset_alias,
meta,
} => {
touch(lateral);
for item in array_exprs.iter() {
render_shape_expr(item);
}
touch(with_ordinality);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
for item in column_defs.iter() {
render_shape_table_function_column(item);
}
touch(with_offset);
if let Some(item) = with_offset_alias.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
TableFactor::NestedJoin { table, alias, meta } => {
render_shape_table_with_joins(table);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::SpecialFunction {
keyword,
precision,
alias,
meta,
} => {
render_shape_special_function_keyword(keyword);
touch(precision);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::Pivot { pivot, alias, meta } => {
render_shape_pivot(pivot);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::Unpivot {
unpivot,
alias,
meta,
} => {
render_shape_unpivot(unpivot);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::MatchRecognize {
match_recognize,
alias,
meta,
} => {
render_shape_match_recognize(match_recognize);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::ShowRef { show, alias, meta } => {
render_shape_show_ref(show);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::JsonTable {
json_table,
alias,
meta,
} => {
render_shape_json_table(json_table);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::XmlTable {
xml_table,
alias,
meta,
} => {
render_shape_xml_table(xml_table);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::OpenJson {
open_json,
alias,
meta,
} => {
render_shape_open_json(open_json);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::TableExpr { expr, alias, meta } => {
render_shape_expr(expr);
if let Some(item) = alias.as_ref() {
render_shape_table_alias(item);
}
touch(meta);
}
TableFactor::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_show_ref<X: Extension>(node: &ShowRef<X>) {
let ShowRef { kind, target, meta } = node;
render_shape_show_ref_kind(kind);
render_shape_show_ref_target(target);
touch(meta);
}
pub(crate) fn render_shape_show_ref_kind(node: &ShowRefKind) {
match node {
ShowRefKind::Describe => {}
ShowRefKind::Desc => {}
ShowRefKind::Show => {}
ShowRefKind::Summarize => {}
}
}
pub(crate) fn render_shape_show_ref_target<X: Extension>(node: &ShowRefTarget<X>) {
match node {
ShowRefTarget::Empty { meta } => {
touch(meta);
}
ShowRefTarget::Query { query, meta } => {
render_shape_query(query);
touch(meta);
}
ShowRefTarget::Name { name, meta } => {
render_shape_object_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_json_table<X: Extension>(node: &JsonTable<X>) {
let JsonTable {
lateral,
context,
path,
path_name,
passing,
columns,
on_error,
meta,
} = node;
touch(lateral);
render_shape_json_value_expr(context);
render_shape_expr(path);
if let Some(item) = path_name.as_ref() {
render_shape_ident(item);
}
for item in passing.iter() {
render_shape_json_passing_arg(item);
}
for item in columns.iter() {
render_shape_json_table_column(item);
}
if let Some(item) = on_error.as_ref() {
render_shape_json_behavior(item);
}
touch(meta);
}
pub(crate) fn render_shape_json_table_column<X: Extension>(node: &JsonTableColumn<X>) {
match node {
JsonTableColumn::ForOrdinality { name, meta } => {
render_shape_ident(name);
touch(meta);
}
JsonTableColumn::Regular {
name,
data_type,
format,
path,
wrapper,
quotes,
on_empty,
on_error,
meta,
} => {
render_shape_ident(name);
render_shape_data_type(data_type);
if let Some(item) = format.as_ref() {
render_shape_json_format(item);
}
if let Some(item) = path.as_ref() {
render_shape_expr(item);
}
render_shape_json_wrapper_behavior(wrapper);
render_shape_json_quotes_behavior(quotes);
if let Some(item) = on_empty.as_ref() {
render_shape_json_behavior(item);
}
if let Some(item) = on_error.as_ref() {
render_shape_json_behavior(item);
}
touch(meta);
}
JsonTableColumn::Exists {
name,
data_type,
path,
on_error,
meta,
} => {
render_shape_ident(name);
render_shape_data_type(data_type);
if let Some(item) = path.as_ref() {
render_shape_expr(item);
}
if let Some(item) = on_error.as_ref() {
render_shape_json_behavior(item);
}
touch(meta);
}
JsonTableColumn::Nested {
path,
path_name,
columns,
meta,
} => {
render_shape_expr(path);
if let Some(item) = path_name.as_ref() {
render_shape_ident(item);
}
for item in columns.iter() {
render_shape_json_table_column(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_xml_table<X: Extension>(node: &XmlTable<X>) {
let XmlTable {
lateral,
namespaces,
row_expr,
document,
passing_mechanism_before,
passing_mechanism_after,
columns,
meta,
} = node;
touch(lateral);
for item in namespaces.iter() {
render_shape_xml_namespace(item);
}
render_shape_expr(row_expr);
render_shape_expr(document);
if let Some(item) = passing_mechanism_before.as_ref() {
render_shape_xml_passing_mechanism(item);
}
if let Some(item) = passing_mechanism_after.as_ref() {
render_shape_xml_passing_mechanism(item);
}
for item in columns.iter() {
render_shape_xml_table_column(item);
}
touch(meta);
}
pub(crate) fn render_shape_xml_namespace<X: Extension>(node: &XmlNamespace<X>) {
let XmlNamespace { uri, name, meta } = node;
render_shape_expr(uri);
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_xml_table_column<X: Extension>(node: &XmlTableColumn<X>) {
match node {
XmlTableColumn::ForOrdinality { name, meta } => {
render_shape_ident(name);
touch(meta);
}
XmlTableColumn::Regular {
name,
data_type,
path,
default,
not_null,
meta,
} => {
render_shape_ident(name);
render_shape_data_type(data_type);
if let Some(item) = path.as_ref() {
render_shape_expr(item);
}
if let Some(item) = default.as_ref() {
render_shape_expr(item);
}
touch(not_null);
touch(meta);
}
}
}
pub(crate) fn render_shape_open_json<X: Extension>(node: &OpenJson<X>) {
let OpenJson {
json_expr,
path,
columns,
meta,
} = node;
render_shape_expr(json_expr);
if let Some(item) = path.as_ref() {
render_shape_expr(item);
}
for item in columns.iter() {
render_shape_open_json_column(item);
}
touch(meta);
}
pub(crate) fn render_shape_open_json_column<X: Extension>(node: &OpenJsonColumn<X>) {
let OpenJsonColumn {
name,
data_type,
path,
as_json,
meta,
} = node;
render_shape_ident(name);
render_shape_data_type(data_type);
if let Some(item) = path.as_ref() {
render_shape_expr(item);
}
touch(as_json);
touch(meta);
}
pub(crate) fn render_shape_join<X: Extension>(node: &Join<X>) {
let Join {
relation,
operator,
meta,
} = node;
render_shape_table_factor(relation);
render_shape_join_operator(operator);
touch(meta);
}
pub(crate) fn render_shape_join_operator<X: Extension>(node: &JoinOperator<X>) {
match node {
JoinOperator::Inner {
straight,
inner,
constraint,
meta,
} => {
touch(straight);
touch(inner);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::LeftOuter {
outer,
constraint,
meta,
} => {
touch(outer);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::RightOuter {
outer,
constraint,
meta,
} => {
touch(outer);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::FullOuter {
outer,
constraint,
meta,
} => {
touch(outer);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::AsOf {
kind,
constraint,
meta,
} => {
render_shape_as_of_join_kind(kind);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::Cross { meta } => {
touch(meta);
}
JoinOperator::Positional { meta } => {
touch(meta);
}
JoinOperator::Semi {
asof,
side,
constraint,
meta,
} => {
touch(asof);
render_shape_semi_anti_side(side);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::Anti {
asof,
side,
constraint,
meta,
} => {
touch(asof);
render_shape_semi_anti_side(side);
render_shape_join_constraint(constraint);
touch(meta);
}
JoinOperator::Apply { kind, meta } => {
render_shape_apply_kind(kind);
touch(meta);
}
}
}
pub(crate) fn render_shape_apply_kind(node: &ApplyKind) {
match node {
ApplyKind::Cross => {}
ApplyKind::Outer => {}
}
}
pub(crate) fn render_shape_semi_anti_side(node: &SemiAntiSide) {
match node {
SemiAntiSide::Sideless => {}
SemiAntiSide::Left => {}
SemiAntiSide::Right => {}
}
}
pub(crate) fn render_shape_as_of_join_kind(node: &AsOfJoinKind) {
match node {
AsOfJoinKind::Inner => {}
AsOfJoinKind::Left => {}
AsOfJoinKind::Right => {}
AsOfJoinKind::Full => {}
}
}
pub(crate) fn render_shape_join_constraint<X: Extension>(node: &JoinConstraint<X>) {
match node {
JoinConstraint::On { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
JoinConstraint::Using {
columns,
alias,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
JoinConstraint::Natural { meta } => {
touch(meta);
}
JoinConstraint::None { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_order_by_expr<X: Extension>(node: &OrderByExpr<X>) {
let OrderByExpr {
expr,
asc,
using,
nulls_first,
meta,
} = node;
render_shape_expr(expr);
touch(asc);
if let Some(item) = using.as_ref() {
render_shape_order_by_using(item);
}
touch(nulls_first);
touch(meta);
}
pub(crate) fn render_shape_order_by_using(node: &OrderByUsing) {
let OrderByUsing { schema, op, meta } = node;
if let Some(item) = schema.as_ref() {
render_shape_object_name(item);
}
touch(op);
touch(meta);
}
pub(crate) fn render_shape_order_by_all(node: &OrderByAll) {
let OrderByAll {
asc,
nulls_first,
meta,
} = node;
touch(asc);
touch(nulls_first);
touch(meta);
}
pub(crate) fn render_shape_limit<X: Extension>(node: &Limit<X>) {
let Limit {
limit,
offset,
syntax,
with_ties,
percent,
fetch_spelling,
meta,
} = node;
if let Some(item) = limit.as_ref() {
render_shape_expr(item);
}
if let Some(item) = offset.as_ref() {
render_shape_expr(item);
}
render_shape_limit_syntax(syntax);
touch(with_ties);
if let Some(item) = percent.as_ref() {
render_shape_limit_percent(item);
}
render_shape_fetch_spelling(fetch_spelling);
touch(meta);
}
pub(crate) fn render_shape_fetch_spelling(node: &FetchSpelling) {
match node {
FetchSpelling::FirstRows => {}
FetchSpelling::FirstRow => {}
FetchSpelling::NextRows => {}
FetchSpelling::NextRow => {}
}
}
pub(crate) fn render_shape_limit_syntax(node: &LimitSyntax) {
match node {
LimitSyntax::LimitOffset => {}
LimitSyntax::CommaOffset => {}
LimitSyntax::FetchFirst => {}
}
}
pub(crate) fn render_shape_limit_percent(node: &LimitPercent) {
match node {
LimitPercent::Symbol => {}
LimitPercent::Keyword => {}
}
}
pub(crate) fn render_shape_limit_by<X: Extension>(node: &LimitBy<X>) {
let LimitBy {
limit,
offset,
by,
meta,
} = node;
render_shape_expr(limit);
if let Some(item) = offset.as_ref() {
render_shape_expr(item);
}
for item in by.iter() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_setting<X: Extension>(node: &Setting<X>) {
let Setting { name, value, meta } = node;
render_shape_ident(name);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_format_clause(node: &FormatClause) {
let FormatClause { name, meta } = node;
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_for_clause(node: &ForClause) {
match node {
ForClause::Xml {
mode,
elements,
binary_base64,
typed,
root,
meta,
} => {
render_shape_for_xml_mode(mode);
if let Some(item) = elements.as_ref() {
render_shape_for_xml_elements(item);
}
touch(binary_base64);
touch(typed);
if let Some(item) = root.as_ref() {
render_shape_for_root(item);
}
touch(meta);
}
ForClause::Json {
mode,
root,
include_null_values,
without_array_wrapper,
meta,
} => {
render_shape_for_json_mode(mode);
if let Some(item) = root.as_ref() {
render_shape_for_root(item);
}
touch(include_null_values);
touch(without_array_wrapper);
touch(meta);
}
}
}
pub(crate) fn render_shape_for_xml_mode(node: &ForXmlMode) {
match node {
ForXmlMode::Raw { name, meta } => {
if let Some(item) = name.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ForXmlMode::Auto { meta } => {
touch(meta);
}
ForXmlMode::Explicit { meta } => {
touch(meta);
}
ForXmlMode::Path { name, meta } => {
if let Some(item) = name.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_for_xml_elements(node: &ForXmlElements) {
match node {
ForXmlElements::Plain => {}
ForXmlElements::XsiNil => {}
ForXmlElements::Absent => {}
}
}
pub(crate) fn render_shape_for_json_mode(node: &ForJsonMode) {
match node {
ForJsonMode::Auto => {}
ForJsonMode::Path => {}
}
}
pub(crate) fn render_shape_for_root(node: &ForRoot) {
let ForRoot { name, meta } = node;
if let Some(item) = name.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_lateral_view<X: Extension>(node: &LateralView<X>) {
let LateralView {
outer,
function,
alias,
columns,
meta,
} = node;
touch(outer);
render_shape_function_call(function);
render_shape_ident(alias);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_hierarchical_clause<X: Extension>(node: &HierarchicalClause<X>) {
let HierarchicalClause {
start_with,
nocycle,
connect_by,
start_with_leads,
meta,
} = node;
if let Some(item) = start_with.as_ref() {
render_shape_expr(item);
}
touch(nocycle);
render_shape_expr(connect_by);
touch(start_with_leads);
touch(meta);
}
pub(crate) fn render_shape_replication_statement(node: &ReplicationStatement) {
match node {
ReplicationStatement::ChangeSource {
options,
channel,
meta,
} => {
for item in options.iter() {
render_shape_change_replication_source_option(item);
}
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationStatement::ChangeFilter {
rules,
channel,
meta,
} => {
for item in rules.iter() {
render_shape_replication_filter_rule(item);
}
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationStatement::StartReplica {
threads,
until,
user,
password,
default_auth,
plugin_dir,
channel,
meta,
} => {
for item in threads.iter() {
render_shape_replica_thread_option(item);
}
for item in until.iter() {
render_shape_replica_until_condition(item);
}
if let Some(item) = user.as_ref() {
render_shape_literal(item);
}
if let Some(item) = password.as_ref() {
render_shape_literal(item);
}
if let Some(item) = default_auth.as_ref() {
render_shape_literal(item);
}
if let Some(item) = plugin_dir.as_ref() {
render_shape_literal(item);
}
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationStatement::StopReplica {
threads,
channel,
meta,
} => {
for item in threads.iter() {
render_shape_replica_thread_option(item);
}
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationStatement::StartGroupReplication { options, meta } => {
for item in options.iter() {
render_shape_group_replication_option(item);
}
touch(meta);
}
ReplicationStatement::StopGroupReplication { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_change_replication_source_option(node: &ChangeReplicationSourceOption) {
let ChangeReplicationSourceOption { name, value, meta } = node;
render_shape_source_option(name);
render_shape_change_replication_source_option_value(value);
touch(meta);
}
pub(crate) fn render_shape_source_option(node: &SourceOption) {
match node {
SourceOption::SourceBind => {}
SourceOption::SourceHost => {}
SourceOption::SourceUser => {}
SourceOption::SourcePassword => {}
SourceOption::SourcePort => {}
SourceOption::SourceConnectRetry => {}
SourceOption::SourceRetryCount => {}
SourceOption::SourceDelay => {}
SourceOption::SourceHeartbeatPeriod => {}
SourceOption::SourceLogFile => {}
SourceOption::SourceLogPos => {}
SourceOption::SourceAutoPosition => {}
SourceOption::RelayLogFile => {}
SourceOption::RelayLogPos => {}
SourceOption::SourceSsl => {}
SourceOption::SourceSslCa => {}
SourceOption::SourceSslCapath => {}
SourceOption::SourceSslCert => {}
SourceOption::SourceSslCipher => {}
SourceOption::SourceSslKey => {}
SourceOption::SourceSslVerifyServerCert => {}
SourceOption::SourceSslCrl => {}
SourceOption::SourceSslCrlpath => {}
SourceOption::SourceTlsVersion => {}
SourceOption::SourceTlsCiphersuites => {}
SourceOption::SourcePublicKeyPath => {}
SourceOption::GetSourcePublicKey => {}
SourceOption::NetworkNamespace => {}
SourceOption::IgnoreServerIds => {}
SourceOption::SourceCompressionAlgorithms => {}
SourceOption::SourceZstdCompressionLevel => {}
SourceOption::PrivilegeChecksUser => {}
SourceOption::RequireRowFormat => {}
SourceOption::RequireTablePrimaryKeyCheck => {}
SourceOption::SourceConnectionAutoFailover => {}
SourceOption::AssignGtidsToAnonymousTransactions => {}
SourceOption::GtidOnly => {}
}
}
pub(crate) fn render_shape_change_replication_source_option_value(
node: &ChangeReplicationSourceOptionValue,
) {
match node {
ChangeReplicationSourceOptionValue::String { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ChangeReplicationSourceOptionValue::Number { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ChangeReplicationSourceOptionValue::NullableString { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ChangeReplicationSourceOptionValue::User { account, meta } => {
if let Some(item) = account.as_ref() {
render_shape_account_name(item);
}
touch(meta);
}
ChangeReplicationSourceOptionValue::ServerIds { ids, meta } => {
for item in ids.iter() {
render_shape_literal(item);
}
touch(meta);
}
ChangeReplicationSourceOptionValue::PrimaryKeyCheck { check, meta } => {
render_shape_require_primary_key_check(check);
touch(meta);
}
ChangeReplicationSourceOptionValue::AssignGtids { kind, uuid, meta } => {
render_shape_assign_gtids_kind(kind);
if let Some(item) = uuid.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_require_primary_key_check(node: &RequirePrimaryKeyCheck) {
match node {
RequirePrimaryKeyCheck::On => {}
RequirePrimaryKeyCheck::Off => {}
RequirePrimaryKeyCheck::Stream => {}
RequirePrimaryKeyCheck::Generate => {}
}
}
pub(crate) fn render_shape_assign_gtids_kind(node: &AssignGtidsKind) {
match node {
AssignGtidsKind::Off => {}
AssignGtidsKind::Local => {}
AssignGtidsKind::Uuid => {}
}
}
pub(crate) fn render_shape_replication_filter_rule(node: &ReplicationFilterRule) {
match node {
ReplicationFilterRule::DoDb { databases, meta } => {
for item in databases.iter() {
render_shape_ident(item);
}
touch(meta);
}
ReplicationFilterRule::IgnoreDb { databases, meta } => {
for item in databases.iter() {
render_shape_ident(item);
}
touch(meta);
}
ReplicationFilterRule::DoTable { tables, meta } => {
for item in tables.iter() {
render_shape_object_name(item);
}
touch(meta);
}
ReplicationFilterRule::IgnoreTable { tables, meta } => {
for item in tables.iter() {
render_shape_object_name(item);
}
touch(meta);
}
ReplicationFilterRule::WildDoTable { patterns, meta } => {
for item in patterns.iter() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationFilterRule::WildIgnoreTable { patterns, meta } => {
for item in patterns.iter() {
render_shape_literal(item);
}
touch(meta);
}
ReplicationFilterRule::RewriteDb { pairs, meta } => {
for item in pairs.iter() {
render_shape_rewrite_db_pair(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_rewrite_db_pair(node: &RewriteDbPair) {
let RewriteDbPair { from, to, meta } = node;
render_shape_ident(from);
render_shape_ident(to);
touch(meta);
}
pub(crate) fn render_shape_replica_thread_option(node: &ReplicaThreadOption) {
match node {
ReplicaThreadOption::Sql { meta } => {
touch(meta);
}
ReplicaThreadOption::Io { keyword, meta } => {
render_shape_io_thread_keyword(keyword);
touch(meta);
}
}
}
pub(crate) fn render_shape_io_thread_keyword(node: &IoThreadKeyword) {
match node {
IoThreadKeyword::Io => {}
IoThreadKeyword::Relay => {}
}
}
pub(crate) fn render_shape_replica_until_condition(node: &ReplicaUntilCondition) {
match node {
ReplicaUntilCondition::SourceLogFile { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::SourceLogPos { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::RelayLogFile { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::RelayLogPos { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::SqlBeforeGtids { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::SqlAfterGtids { value, meta } => {
render_shape_literal(value);
touch(meta);
}
ReplicaUntilCondition::SqlAfterMtsGaps { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_group_replication_option(node: &GroupReplicationOption) {
match node {
GroupReplicationOption::User { value, meta } => {
render_shape_literal(value);
touch(meta);
}
GroupReplicationOption::Password { value, meta } => {
render_shape_literal(value);
touch(meta);
}
GroupReplicationOption::DefaultAuth { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_statement<X: Extension>(node: &Statement<X>) {
match node {
Statement::Query { query, meta } => {
render_shape_query(query);
touch(meta);
}
Statement::CreateTable { create, meta } => {
render_shape_create_table(create);
touch(meta);
}
Statement::AlterTable { alter, meta } => {
render_shape_alter_table(alter);
touch(meta);
}
Statement::Drop { drop, meta } => {
render_shape_drop_statement(drop);
touch(meta);
}
Statement::CreateSchema { schema, meta } => {
render_shape_create_schema(schema);
touch(meta);
}
Statement::CreateView { view, meta } => {
render_shape_create_view(view);
touch(meta);
}
Statement::RefreshMaterializedView { refresh, meta } => {
render_shape_refresh_materialized_view(refresh);
touch(meta);
}
Statement::CreateColocationGroup { create, meta } => {
render_shape_create_colocation_group(create);
touch(meta);
}
Statement::DropColocationGroup { drop, meta } => {
render_shape_drop_colocation_group(drop);
touch(meta);
}
Statement::AlterView { alter, meta } => {
render_shape_alter_view(alter);
touch(meta);
}
Statement::CreateIndex { index, meta } => {
render_shape_create_index(index);
touch(meta);
}
Statement::CreateFunction { create, meta } => {
render_shape_create_function(create);
touch(meta);
}
Statement::CreateProcedure { create, meta } => {
render_shape_create_procedure(create);
touch(meta);
}
Statement::AlterRoutine { alter, meta } => {
render_shape_alter_routine(alter);
touch(meta);
}
Statement::CreateEvent { create, meta } => {
render_shape_create_event(create);
touch(meta);
}
Statement::AlterEvent { alter, meta } => {
render_shape_alter_event(alter);
touch(meta);
}
Statement::DropEvent { drop, meta } => {
render_shape_drop_event(drop);
touch(meta);
}
Statement::DropDatabase { drop, meta } => {
render_shape_drop_database(drop);
touch(meta);
}
Statement::DropIndex { drop, meta } => {
render_shape_drop_index_on_table(drop);
touch(meta);
}
Statement::CreateDatabase { create, meta } => {
render_shape_create_database(create);
touch(meta);
}
Statement::DropRoutine {
kind,
if_exists,
routines,
behavior,
meta,
} => {
render_shape_routine_object_kind(kind);
touch(if_exists);
for item in routines.iter() {
render_shape_routine_signature(item);
}
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
Statement::DropTransform { drop, meta } => {
render_shape_drop_transform(drop);
touch(meta);
}
Statement::Truncate {
tables,
table_keyword,
restart_identity,
behavior,
meta,
} => {
for item in tables.iter() {
render_shape_object_name(item);
}
touch(table_keyword);
touch(restart_identity);
if let Some(item) = behavior.as_ref() {
render_shape_drop_behavior(item);
}
touch(meta);
}
Statement::CommentOn { comment, meta } => {
render_shape_comment_on_statement(comment);
touch(meta);
}
Statement::Insert { insert, meta } => {
render_shape_insert(insert);
touch(meta);
}
Statement::Update { update, meta } => {
render_shape_update(update);
touch(meta);
}
Statement::Delete { delete, meta } => {
render_shape_delete(delete);
touch(meta);
}
Statement::Merge { merge, meta } => {
render_shape_merge(merge);
touch(meta);
}
Statement::Transaction { transaction, meta } => {
render_shape_transaction_statement(transaction);
touch(meta);
}
Statement::Xa { xa, meta } => {
render_shape_xa_statement(xa);
touch(meta);
}
Statement::Session { session, meta } => {
render_shape_session_statement(session);
touch(meta);
}
Statement::AccessControl { access, meta } => {
render_shape_access_control_statement(access);
touch(meta);
}
Statement::Copy { copy, meta } => {
render_shape_copy_statement(copy);
touch(meta);
}
Statement::CopyInto { copy, meta } => {
render_shape_copy_into_statement(copy);
touch(meta);
}
Statement::Export { export, meta } => {
render_shape_export_statement(export);
touch(meta);
}
Statement::Import { import, meta } => {
render_shape_import_statement(import);
touch(meta);
}
Statement::Explain { explain, meta } => {
render_shape_explain_statement(explain);
touch(meta);
}
Statement::Describe { describe, meta } => {
render_shape_describe_statement(describe);
touch(meta);
}
Statement::Show { show, meta } => {
render_shape_show_statement(show);
touch(meta);
}
Statement::Kill { kill, meta } => {
render_shape_kill_statement(kill);
touch(meta);
}
Statement::Handler { handler, meta } => {
render_shape_handler_statement(handler);
touch(meta);
}
Statement::Install { install, meta } => {
render_shape_install_statement(install);
touch(meta);
}
Statement::Uninstall { uninstall, meta } => {
render_shape_uninstall_statement(uninstall);
touch(meta);
}
Statement::Shutdown { meta } => {
touch(meta);
}
Statement::Restart { meta } => {
touch(meta);
}
Statement::Clone { clone, meta } => {
render_shape_clone_statement(clone);
touch(meta);
}
Statement::ImportTable { import_table, meta } => {
render_shape_import_table_statement(import_table);
touch(meta);
}
Statement::Help { help, meta } => {
render_shape_help_statement(help);
touch(meta);
}
Statement::Binlog { binlog, meta } => {
render_shape_binlog_statement(binlog);
touch(meta);
}
Statement::Pragma { pragma, meta } => {
render_shape_pragma_statement(pragma);
touch(meta);
}
Statement::Attach { attach, meta } => {
render_shape_attach_statement(attach);
touch(meta);
}
Statement::Detach { detach, meta } => {
render_shape_detach_statement(detach);
touch(meta);
}
Statement::Checkpoint { checkpoint, meta } => {
render_shape_checkpoint_statement(checkpoint);
touch(meta);
}
Statement::Load { load, meta } => {
render_shape_load_statement(load);
touch(meta);
}
Statement::LoadData { load_data, meta } => {
render_shape_load_data_statement(load_data);
touch(meta);
}
Statement::UpdateExtensions {
update_extensions,
meta,
} => {
render_shape_update_extensions_statement(update_extensions);
touch(meta);
}
Statement::Vacuum { vacuum, meta } => {
render_shape_vacuum_statement(vacuum);
touch(meta);
}
Statement::Reindex { reindex, meta } => {
render_shape_reindex_statement(reindex);
touch(meta);
}
Statement::Analyze { analyze, meta } => {
render_shape_analyze_statement(analyze);
touch(meta);
}
Statement::TableMaintenance {
table_maintenance,
meta,
} => {
render_shape_table_maintenance_statement(table_maintenance);
touch(meta);
}
Statement::CacheIndex { cache_index, meta } => {
render_shape_cache_index_statement(cache_index);
touch(meta);
}
Statement::LoadIndex { load_index, meta } => {
render_shape_load_index_statement(load_index);
touch(meta);
}
Statement::Rename { rename, meta } => {
render_shape_rename_statement(rename);
touch(meta);
}
Statement::Flush { flush, meta } => {
render_shape_flush_statement(flush);
touch(meta);
}
Statement::Purge { purge, meta } => {
render_shape_purge_statement(purge);
touch(meta);
}
Statement::Replication { replication, meta } => {
render_shape_replication_statement(replication);
touch(meta);
}
Statement::CreateUser { create, meta } => {
render_shape_create_user(create);
touch(meta);
}
Statement::AlterUser { alter, meta } => {
render_shape_alter_user(alter);
touch(meta);
}
Statement::UserRoleList { statement, meta } => {
render_shape_user_role_list(statement);
touch(meta);
}
Statement::Use {
use_statement,
meta,
} => {
render_shape_use_statement(use_statement);
touch(meta);
}
Statement::CreateTrigger { create, meta } => {
render_shape_create_trigger(create);
touch(meta);
}
Statement::CreateStoredTrigger { create, meta } => {
render_shape_create_stored_trigger(create);
touch(meta);
}
Statement::CreateMacro { create, meta } => {
render_shape_create_macro(create);
touch(meta);
}
Statement::CreateSecret { create, meta } => {
render_shape_create_secret(create);
touch(meta);
}
Statement::DropSecret { drop, meta } => {
render_shape_drop_secret_stmt(drop);
touch(meta);
}
Statement::CreateType { create, meta } => {
render_shape_create_type(create);
touch(meta);
}
Statement::CreateVirtualTable { create, meta } => {
render_shape_create_virtual_table(create);
touch(meta);
}
Statement::CreateSequence { create, meta } => {
render_shape_create_sequence(create);
touch(meta);
}
Statement::CreateExtension { create, meta } => {
render_shape_create_extension(create);
touch(meta);
}
Statement::AlterExtension { alter, meta } => {
render_shape_alter_extension(alter);
touch(meta);
}
Statement::CreateTablespace { create, meta } => {
render_shape_create_tablespace(create);
touch(meta);
}
Statement::AlterTablespace { alter, meta } => {
render_shape_alter_tablespace(alter);
touch(meta);
}
Statement::DropTablespace { drop, meta } => {
render_shape_drop_tablespace(drop);
touch(meta);
}
Statement::CreateLogfileGroup { create, meta } => {
render_shape_create_logfile_group(create);
touch(meta);
}
Statement::AlterLogfileGroup { alter, meta } => {
render_shape_alter_logfile_group(alter);
touch(meta);
}
Statement::DropLogfileGroup { drop, meta } => {
render_shape_drop_logfile_group(drop);
touch(meta);
}
Statement::AlterObjectDepends { alter, meta } => {
render_shape_alter_object_depends(alter);
touch(meta);
}
Statement::AlterSystem { alter, meta } => {
render_shape_alter_system(alter);
touch(meta);
}
Statement::AlterDatabase { alter, meta } => {
render_shape_alter_database(alter);
touch(meta);
}
Statement::AlterDatabaseOptions { alter, meta } => {
render_shape_alter_database_options(alter);
touch(meta);
}
Statement::CreateServer { create, meta } => {
render_shape_create_server(create);
touch(meta);
}
Statement::AlterServer { alter, meta } => {
render_shape_alter_server(alter);
touch(meta);
}
Statement::DropServer { drop, meta } => {
render_shape_drop_server(drop);
touch(meta);
}
Statement::AlterInstance { alter, meta } => {
render_shape_alter_instance(alter);
touch(meta);
}
Statement::CreateSpatialReferenceSystem { create, meta } => {
render_shape_create_spatial_reference_system(create);
touch(meta);
}
Statement::DropSpatialReferenceSystem { drop, meta } => {
render_shape_drop_spatial_reference_system(drop);
touch(meta);
}
Statement::CreateResourceGroup { create, meta } => {
render_shape_create_resource_group(create);
touch(meta);
}
Statement::AlterResourceGroup { alter, meta } => {
render_shape_alter_resource_group(alter);
touch(meta);
}
Statement::DropResourceGroup { drop, meta } => {
render_shape_drop_resource_group(drop);
touch(meta);
}
Statement::AlterSequence { alter, meta } => {
render_shape_alter_sequence(alter);
touch(meta);
}
Statement::AlterObjectSchema { alter, meta } => {
render_shape_alter_object_schema(alter);
touch(meta);
}
Statement::Pivot { pivot, meta } => {
render_shape_pivot(pivot);
touch(meta);
}
Statement::Unpivot { unpivot, meta } => {
render_shape_unpivot(unpivot);
touch(meta);
}
Statement::ShowRef { show, meta } => {
render_shape_show_ref(show);
touch(meta);
}
Statement::Prepare { prepare, meta } => {
render_shape_prepare_statement(prepare);
touch(meta);
}
Statement::Execute { execute, meta } => {
render_shape_execute_statement(execute);
touch(meta);
}
Statement::PrepareFrom { prepare_from, meta } => {
render_shape_prepare_from_statement(prepare_from);
touch(meta);
}
Statement::ExecuteUsing {
execute_using,
meta,
} => {
render_shape_execute_using_statement(execute_using);
touch(meta);
}
Statement::Deallocate { deallocate, meta } => {
render_shape_deallocate_statement(deallocate);
touch(meta);
}
Statement::Call { call, meta } => {
render_shape_call_statement(call);
touch(meta);
}
Statement::Do { do_block, meta } => {
render_shape_do_statement(do_block);
touch(meta);
}
Statement::DoExpressions {
do_expressions,
meta,
} => {
render_shape_do_expressions_statement(do_expressions);
touch(meta);
}
Statement::LockTables { lock_tables, meta } => {
render_shape_lock_tables_statement(lock_tables);
touch(meta);
}
Statement::UnlockTables {
unlock_tables,
meta,
} => {
render_shape_unlock_tables_statement(unlock_tables);
touch(meta);
}
Statement::InstanceLock {
instance_lock,
meta,
} => {
render_shape_instance_lock_statement(instance_lock);
touch(meta);
}
Statement::Compound { compound, meta } => {
render_shape_compound_statement(compound);
touch(meta);
}
Statement::If { if_statement, meta } => {
render_shape_if_statement(if_statement);
touch(meta);
}
Statement::Case {
case_statement,
meta,
} => {
render_shape_case_statement(case_statement);
touch(meta);
}
Statement::Loop {
loop_statement,
meta,
} => {
render_shape_loop_statement(loop_statement);
touch(meta);
}
Statement::While {
while_statement,
meta,
} => {
render_shape_while_statement(while_statement);
touch(meta);
}
Statement::Repeat { repeat, meta } => {
render_shape_repeat_statement(repeat);
touch(meta);
}
Statement::Leave { leave, meta } => {
render_shape_leave_statement(leave);
touch(meta);
}
Statement::Iterate { iterate, meta } => {
render_shape_iterate_statement(iterate);
touch(meta);
}
Statement::Return {
return_statement,
meta,
} => {
render_shape_return_statement(return_statement);
touch(meta);
}
Statement::OpenCursor { open, meta } => {
render_shape_open_cursor_statement(open);
touch(meta);
}
Statement::FetchCursor { fetch, meta } => {
render_shape_fetch_cursor_statement(fetch);
touch(meta);
}
Statement::CloseCursor { close, meta } => {
render_shape_close_cursor_statement(close);
touch(meta);
}
Statement::Signal { signal, meta } => {
render_shape_signal_statement(signal);
touch(meta);
}
Statement::Resignal { resignal, meta } => {
render_shape_signal_statement(resignal);
touch(meta);
}
Statement::GetDiagnostics {
get_diagnostics,
meta,
} => {
render_shape_get_diagnostics_statement(get_diagnostics);
touch(meta);
}
Statement::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_compound_statement<X: Extension>(node: &CompoundStatement<X>) {
let CompoundStatement {
label,
declarations,
body,
end_label,
meta,
} = node;
if let Some(item) = label.as_ref() {
render_shape_ident(item);
}
for item in declarations.iter() {
render_shape_declaration(item);
}
for item in body.iter() {
render_shape_statement(item);
}
if let Some(item) = end_label.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_declaration<X: Extension>(node: &Declaration<X>) {
match node {
Declaration::Variable {
names,
data_type,
default,
meta,
} => {
for item in names.iter() {
render_shape_ident(item);
}
render_shape_data_type(data_type);
if let Some(item) = default.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
Declaration::Condition { name, value, meta } => {
render_shape_ident(name);
render_shape_condition_value(value);
touch(meta);
}
Declaration::Cursor { name, query, meta } => {
render_shape_ident(name);
render_shape_query(query);
touch(meta);
}
Declaration::Handler {
action,
conditions,
body,
meta,
} => {
render_shape_handler_action(action);
for item in conditions.iter() {
render_shape_handler_condition(item);
}
render_shape_statement(body);
touch(meta);
}
}
}
pub(crate) fn render_shape_handler_action(node: &HandlerAction) {
match node {
HandlerAction::Continue => {}
HandlerAction::Exit => {}
HandlerAction::Undo => {}
}
}
pub(crate) fn render_shape_condition_value(node: &ConditionValue) {
match node {
ConditionValue::SqlState {
value_keyword,
sqlstate,
meta,
} => {
touch(value_keyword);
render_shape_literal(sqlstate);
touch(meta);
}
ConditionValue::ErrorCode { code, meta } => {
render_shape_literal(code);
touch(meta);
}
ConditionValue::ConditionName { name, meta } => {
render_shape_ident(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_handler_condition(node: &HandlerCondition) {
match node {
HandlerCondition::SqlState {
value_keyword,
sqlstate,
meta,
} => {
touch(value_keyword);
render_shape_literal(sqlstate);
touch(meta);
}
HandlerCondition::ErrorCode { code, meta } => {
render_shape_literal(code);
touch(meta);
}
HandlerCondition::ConditionName { name, meta } => {
render_shape_ident(name);
touch(meta);
}
HandlerCondition::SqlWarning { meta } => {
touch(meta);
}
HandlerCondition::NotFound { meta } => {
touch(meta);
}
HandlerCondition::SqlException { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_if_statement<X: Extension>(node: &IfStatement<X>) {
let IfStatement {
branches,
else_body,
meta,
} = node;
for item in branches.iter() {
render_shape_conditional_branch(item);
}
if let Some(item) = else_body.as_ref() {
for item1 in item.iter() {
render_shape_statement(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_conditional_branch<X: Extension>(node: &ConditionalBranch<X>) {
let ConditionalBranch { guard, body, meta } = node;
render_shape_expr(guard);
for item in body.iter() {
render_shape_statement(item);
}
touch(meta);
}
pub(crate) fn render_shape_case_statement<X: Extension>(node: &CaseStatement<X>) {
let CaseStatement {
operand,
when_branches,
else_body,
meta,
} = node;
if let Some(item) = operand.as_ref() {
render_shape_expr(item);
}
for item in when_branches.iter() {
render_shape_conditional_branch(item);
}
if let Some(item) = else_body.as_ref() {
for item1 in item.iter() {
render_shape_statement(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_loop_statement<X: Extension>(node: &LoopStatement<X>) {
let LoopStatement {
label,
body,
end_label,
meta,
} = node;
if let Some(item) = label.as_ref() {
render_shape_ident(item);
}
for item in body.iter() {
render_shape_statement(item);
}
if let Some(item) = end_label.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_while_statement<X: Extension>(node: &WhileStatement<X>) {
let WhileStatement {
label,
condition,
body,
end_label,
meta,
} = node;
if let Some(item) = label.as_ref() {
render_shape_ident(item);
}
render_shape_expr(condition);
for item in body.iter() {
render_shape_statement(item);
}
if let Some(item) = end_label.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_repeat_statement<X: Extension>(node: &RepeatStatement<X>) {
let RepeatStatement {
label,
body,
condition,
end_label,
meta,
} = node;
if let Some(item) = label.as_ref() {
render_shape_ident(item);
}
for item in body.iter() {
render_shape_statement(item);
}
render_shape_expr(condition);
if let Some(item) = end_label.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_leave_statement(node: &LeaveStatement) {
let LeaveStatement { label, meta } = node;
render_shape_ident(label);
touch(meta);
}
pub(crate) fn render_shape_iterate_statement(node: &IterateStatement) {
let IterateStatement { label, meta } = node;
render_shape_ident(label);
touch(meta);
}
pub(crate) fn render_shape_return_statement<X: Extension>(node: &ReturnStatement<X>) {
let ReturnStatement { value, meta } = node;
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_open_cursor_statement(node: &OpenCursorStatement) {
let OpenCursorStatement { cursor, meta } = node;
render_shape_ident(cursor);
touch(meta);
}
pub(crate) fn render_shape_close_cursor_statement(node: &CloseCursorStatement) {
let CloseCursorStatement { cursor, meta } = node;
render_shape_ident(cursor);
touch(meta);
}
pub(crate) fn render_shape_fetch_cursor_statement(node: &FetchCursorStatement) {
let FetchCursorStatement {
next_keyword,
from_keyword,
cursor,
targets,
meta,
} = node;
touch(next_keyword);
touch(from_keyword);
render_shape_ident(cursor);
for item in targets.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_signal_statement<X: Extension>(node: &SignalStatement<X>) {
let SignalStatement {
condition,
set_items,
meta,
} = node;
if let Some(item) = condition.as_ref() {
render_shape_condition_value(item);
}
for item in set_items.iter() {
render_shape_signal_item(item);
}
touch(meta);
}
pub(crate) fn render_shape_signal_item<X: Extension>(node: &SignalItem<X>) {
let SignalItem { name, value, meta } = node;
render_shape_signal_item_name(name);
render_shape_expr(value);
touch(meta);
}
pub(crate) fn render_shape_signal_item_name(node: &SignalItemName) {
match node {
SignalItemName::ClassOrigin => {}
SignalItemName::SubclassOrigin => {}
SignalItemName::ConstraintCatalog => {}
SignalItemName::ConstraintSchema => {}
SignalItemName::ConstraintName => {}
SignalItemName::CatalogName => {}
SignalItemName::SchemaName => {}
SignalItemName::TableName => {}
SignalItemName::ColumnName => {}
SignalItemName::CursorName => {}
SignalItemName::MessageText => {}
SignalItemName::MysqlErrno => {}
}
}
pub(crate) fn render_shape_get_diagnostics_statement<X: Extension>(
node: &GetDiagnosticsStatement<X>,
) {
let GetDiagnosticsStatement { area, info, meta } = node;
render_shape_diagnostics_area(area);
render_shape_diagnostics_info(info);
touch(meta);
}
pub(crate) fn render_shape_diagnostics_area(node: &DiagnosticsArea) {
match node {
DiagnosticsArea::Implicit => {}
DiagnosticsArea::Current => {}
DiagnosticsArea::Stacked => {}
}
}
pub(crate) fn render_shape_diagnostics_info<X: Extension>(node: &DiagnosticsInfo<X>) {
match node {
DiagnosticsInfo::Statement { items, meta } => {
for item in items.iter() {
render_shape_statement_info_item(item);
}
touch(meta);
}
DiagnosticsInfo::Condition {
number,
items,
meta,
} => {
render_shape_expr(number);
for item in items.iter() {
render_shape_condition_info_item(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_statement_info_item<X: Extension>(node: &StatementInfoItem<X>) {
let StatementInfoItem { target, name, meta } = node;
render_shape_expr(target);
render_shape_statement_info_item_name(name);
touch(meta);
}
pub(crate) fn render_shape_statement_info_item_name(node: &StatementInfoItemName) {
match node {
StatementInfoItemName::Number => {}
StatementInfoItemName::RowCount => {}
}
}
pub(crate) fn render_shape_condition_info_item<X: Extension>(node: &ConditionInfoItem<X>) {
let ConditionInfoItem { target, name, meta } = node;
render_shape_expr(target);
render_shape_condition_info_item_name(name);
touch(meta);
}
pub(crate) fn render_shape_condition_info_item_name(node: &ConditionInfoItemName) {
match node {
ConditionInfoItemName::ClassOrigin => {}
ConditionInfoItemName::SubclassOrigin => {}
ConditionInfoItemName::ConstraintCatalog => {}
ConditionInfoItemName::ConstraintSchema => {}
ConditionInfoItemName::ConstraintName => {}
ConditionInfoItemName::CatalogName => {}
ConditionInfoItemName::SchemaName => {}
ConditionInfoItemName::TableName => {}
ConditionInfoItemName::ColumnName => {}
ConditionInfoItemName::CursorName => {}
ConditionInfoItemName::MessageText => {}
ConditionInfoItemName::MysqlErrno => {}
ConditionInfoItemName::ReturnedSqlstate => {}
}
}
pub(crate) fn render_shape_transaction_statement(node: &TransactionStatement) {
match node {
TransactionStatement::Begin {
syntax,
mode,
block,
name,
modes,
meta,
} => {
render_shape_transaction_start(syntax);
if let Some(item) = mode.as_ref() {
render_shape_transaction_mode_kind(item);
}
if let Some(item) = block.as_ref() {
render_shape_transaction_block_keyword(item);
}
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
for item in modes.iter() {
render_shape_transaction_mode(item);
}
touch(meta);
}
TransactionStatement::Commit {
syntax,
block,
name,
chain,
release,
meta,
} => {
render_shape_transaction_commit_keyword(syntax);
if let Some(item) = block.as_ref() {
render_shape_transaction_block_keyword(item);
}
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
touch(chain);
touch(release);
touch(meta);
}
TransactionStatement::Rollback {
syntax,
block,
name,
savepoint_keyword,
to_savepoint,
chain,
release,
meta,
} => {
render_shape_transaction_rollback_keyword(syntax);
if let Some(item) = block.as_ref() {
render_shape_transaction_block_keyword(item);
}
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
touch(savepoint_keyword);
if let Some(item) = to_savepoint.as_ref() {
render_shape_ident(item);
}
touch(chain);
touch(release);
touch(meta);
}
TransactionStatement::Savepoint { name, meta } => {
render_shape_ident(name);
touch(meta);
}
TransactionStatement::Release {
savepoint_keyword,
savepoint,
meta,
} => {
touch(savepoint_keyword);
render_shape_ident(savepoint);
touch(meta);
}
TransactionStatement::SetCharacteristics { modes, meta } => {
for item in modes.iter() {
render_shape_transaction_mode(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_transaction_start(node: &TransactionStart) {
match node {
TransactionStart::Begin => {}
TransactionStart::Start => {}
}
}
pub(crate) fn render_shape_transaction_commit_keyword(node: &TransactionCommitKeyword) {
match node {
TransactionCommitKeyword::Commit => {}
TransactionCommitKeyword::End => {}
}
}
pub(crate) fn render_shape_transaction_rollback_keyword(node: &TransactionRollbackKeyword) {
match node {
TransactionRollbackKeyword::Rollback => {}
TransactionRollbackKeyword::Abort => {}
}
}
pub(crate) fn render_shape_transaction_block_keyword(node: &TransactionBlockKeyword) {
match node {
TransactionBlockKeyword::Transaction => {}
TransactionBlockKeyword::Work => {}
}
}
pub(crate) fn render_shape_transaction_mode_kind(node: &TransactionModeKind) {
match node {
TransactionModeKind::Deferred => {}
TransactionModeKind::Immediate => {}
TransactionModeKind::Exclusive => {}
}
}
pub(crate) fn render_shape_transaction_mode(node: &TransactionMode) {
match node {
TransactionMode::IsolationLevel { level, meta } => {
render_shape_isolation_level(level);
touch(meta);
}
TransactionMode::AccessMode { access, meta } => {
render_shape_transaction_access_mode(access);
touch(meta);
}
TransactionMode::Deferrable { deferrable, meta } => {
touch(deferrable);
touch(meta);
}
TransactionMode::ConsistentSnapshot { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_isolation_level(node: &IsolationLevel) {
match node {
IsolationLevel::ReadUncommitted => {}
IsolationLevel::ReadCommitted => {}
IsolationLevel::RepeatableRead => {}
IsolationLevel::Serializable => {}
}
}
pub(crate) fn render_shape_transaction_access_mode(node: &TransactionAccessMode) {
match node {
TransactionAccessMode::ReadOnly => {}
TransactionAccessMode::ReadWrite => {}
}
}
pub(crate) fn render_shape_xa_statement(node: &XaStatement) {
match node {
XaStatement::Start {
keyword,
xid,
association,
meta,
} => {
render_shape_xa_start_keyword(keyword);
render_shape_xid(xid);
if let Some(item) = association.as_ref() {
render_shape_xa_association(item);
}
touch(meta);
}
XaStatement::End { xid, suspend, meta } => {
render_shape_xid(xid);
if let Some(item) = suspend.as_ref() {
render_shape_xa_suspend(item);
}
touch(meta);
}
XaStatement::Prepare { xid, meta } => {
render_shape_xid(xid);
touch(meta);
}
XaStatement::Commit {
xid,
one_phase,
meta,
} => {
render_shape_xid(xid);
touch(one_phase);
touch(meta);
}
XaStatement::Rollback { xid, meta } => {
render_shape_xid(xid);
touch(meta);
}
XaStatement::Recover { convert_xid, meta } => {
touch(convert_xid);
touch(meta);
}
}
}
pub(crate) fn render_shape_xa_start_keyword(node: &XaStartKeyword) {
match node {
XaStartKeyword::Start => {}
XaStartKeyword::Begin => {}
}
}
pub(crate) fn render_shape_xa_association(node: &XaAssociation) {
match node {
XaAssociation::Join => {}
XaAssociation::Resume => {}
}
}
pub(crate) fn render_shape_xa_suspend(node: &XaSuspend) {
match node {
XaSuspend::Suspend => {}
XaSuspend::SuspendForMigrate => {}
}
}
pub(crate) fn render_shape_xid(node: &Xid) {
let Xid {
gtrid,
bqual,
format_id,
meta,
} = node;
render_shape_literal(gtrid);
if let Some(item) = bqual.as_ref() {
render_shape_literal(item);
}
if let Some(item) = format_id.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_data_type<X: Extension>(node: &DataType<X>) {
match node {
DataType::Boolean { spelling, meta } => {
render_shape_boolean_type_name(spelling);
touch(meta);
}
DataType::TinyInt {
display_width,
meta,
} => {
touch(display_width);
touch(meta);
}
DataType::SmallInt {
display_width,
meta,
} => {
touch(display_width);
touch(meta);
}
DataType::MediumInt {
display_width,
meta,
} => {
touch(display_width);
touch(meta);
}
DataType::Integer {
spelling,
display_width,
meta,
} => {
render_shape_integer_type_name(spelling);
touch(display_width);
touch(meta);
}
DataType::BigInt {
display_width,
meta,
} => {
touch(display_width);
touch(meta);
}
DataType::Decimal {
spelling,
precision,
scale,
meta,
} => {
render_shape_decimal_type_name(spelling);
touch(precision);
touch(scale);
touch(meta);
}
DataType::Float { precision, meta } => {
touch(precision);
touch(meta);
}
DataType::Real { meta } => {
touch(meta);
}
DataType::Double { spelling, meta } => {
render_shape_double_type_name(spelling);
touch(meta);
}
DataType::Text {
spelling,
charset,
meta,
} => {
render_shape_text_type_name(spelling);
if let Some(item) = charset.as_ref() {
render_shape_charset_annotation(item);
}
touch(meta);
}
DataType::Blob { spelling, meta } => {
render_shape_blob_type_name(spelling);
touch(meta);
}
DataType::Character {
spelling,
size,
charset,
meta,
} => {
render_shape_character_type_name(spelling);
touch(size);
if let Some(item) = charset.as_ref() {
render_shape_charset_annotation(item);
}
touch(meta);
}
DataType::Binary {
spelling,
size,
meta,
} => {
render_shape_binary_type_name(spelling);
touch(size);
touch(meta);
}
DataType::Bit {
varying,
size,
meta,
} => {
touch(varying);
touch(size);
touch(meta);
}
DataType::Json { meta } => {
touch(meta);
}
DataType::Uuid { meta } => {
touch(meta);
}
DataType::Date { meta } => {
touch(meta);
}
DataType::Time {
spelling,
precision,
time_zone,
meta,
} => {
render_shape_time_type_name(spelling);
touch(precision);
render_shape_time_zone(time_zone);
touch(meta);
}
DataType::Timestamp {
spelling,
precision,
time_zone,
meta,
} => {
render_shape_timestamp_type_name(spelling);
touch(precision);
render_shape_time_zone(time_zone);
touch(meta);
}
DataType::Interval {
fields,
precision,
meta,
} => {
if let Some(item) = fields.as_ref() {
render_shape_interval_fields(item);
}
touch(precision);
touch(meta);
}
DataType::Enum {
values,
charset,
meta,
} => {
for item in values.iter() {
render_shape_literal(item);
}
if let Some(item) = charset.as_ref() {
render_shape_charset_annotation(item);
}
touch(meta);
}
DataType::Set {
values,
charset,
meta,
} => {
for item in values.iter() {
render_shape_literal(item);
}
if let Some(item) = charset.as_ref() {
render_shape_charset_annotation(item);
}
touch(meta);
}
DataType::NumericModifier {
element,
signedness,
zerofill,
meta,
} => {
if let Some(item) = element.as_ref() {
render_shape_data_type(item);
}
render_shape_signedness(signedness);
touch(zerofill);
touch(meta);
}
DataType::Array {
element,
size,
spelling,
meta,
} => {
render_shape_data_type(element);
touch(size);
render_shape_array_type_spelling(spelling);
touch(meta);
}
DataType::Struct {
fields,
spelling,
meta,
} => {
for item in fields.iter() {
render_shape_struct_type_field(item);
}
render_shape_struct_type_spelling(spelling);
touch(meta);
}
DataType::Union { members, meta } => {
for item in members.iter() {
render_shape_struct_type_field(item);
}
touch(meta);
}
DataType::Map { key, value, meta } => {
render_shape_data_type(key);
render_shape_data_type(value);
touch(meta);
}
DataType::Wrapped { kind, inner, meta } => {
render_shape_wrapped_type_kind(kind);
render_shape_data_type(inner);
touch(meta);
}
DataType::FixedString { length, meta } => {
touch(length);
touch(meta);
}
DataType::DateTime64 {
precision,
timezone,
meta,
} => {
touch(precision);
if let Some(item) = timezone.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
DataType::Nested { fields, meta } => {
for item in fields.iter() {
render_shape_struct_type_field(item);
}
touch(meta);
}
DataType::FixedWidthInt {
signed,
width,
meta,
} => {
touch(signed);
render_shape_int_width(width);
touch(meta);
}
DataType::UserDefined {
name,
modifiers,
meta,
} => {
render_shape_object_name(name);
for item in modifiers.iter() {
render_shape_literal(item);
}
touch(meta);
}
DataType::Liberal { words, args, meta } => {
for item in words.iter() {
render_shape_ident(item);
}
touch(args);
touch(meta);
}
DataType::Other { ext, meta } => {
render_shape_extension(ext);
touch(meta);
}
}
}
pub(crate) fn render_shape_struct_type_field<X: Extension>(node: &StructTypeField<X>) {
let StructTypeField { name, ty, meta } = node;
render_shape_ident(name);
render_shape_data_type(ty);
touch(meta);
}
pub(crate) fn render_shape_struct_type_spelling(node: &StructTypeSpelling) {
match node {
StructTypeSpelling::Struct => {}
StructTypeSpelling::Row => {}
StructTypeSpelling::AngleBracket => {}
}
}
pub(crate) fn render_shape_array_type_spelling(node: &ArrayTypeSpelling) {
match node {
ArrayTypeSpelling::Bracket => {}
ArrayTypeSpelling::Keyword => {}
ArrayTypeSpelling::AngleBracket => {}
}
}
pub(crate) fn render_shape_wrapped_type_kind(node: &WrappedTypeKind) {
match node {
WrappedTypeKind::Nullable => {}
WrappedTypeKind::LowCardinality => {}
}
}
pub(crate) fn render_shape_boolean_type_name(node: &BooleanTypeName) {
match node {
BooleanTypeName::Boolean => {}
BooleanTypeName::Bool => {}
}
}
pub(crate) fn render_shape_integer_type_name(node: &IntegerTypeName) {
match node {
IntegerTypeName::Int => {}
IntegerTypeName::Integer => {}
}
}
pub(crate) fn render_shape_int_width(node: &IntWidth) {
match node {
IntWidth::W8 => {}
IntWidth::W16 => {}
IntWidth::W32 => {}
IntWidth::W64 => {}
IntWidth::W128 => {}
IntWidth::W256 => {}
}
}
pub(crate) fn render_shape_decimal_type_name(node: &DecimalTypeName) {
match node {
DecimalTypeName::Decimal => {}
DecimalTypeName::Dec => {}
DecimalTypeName::Numeric => {}
}
}
pub(crate) fn render_shape_double_type_name(node: &DoubleTypeName) {
match node {
DoubleTypeName::DoublePrecision => {}
DoubleTypeName::Double => {}
}
}
pub(crate) fn render_shape_text_type_name(node: &TextTypeName) {
match node {
TextTypeName::Text => {}
TextTypeName::TinyText => {}
TextTypeName::MediumText => {}
TextTypeName::LongText => {}
}
}
pub(crate) fn render_shape_blob_type_name(node: &BlobTypeName) {
match node {
BlobTypeName::Blob => {}
BlobTypeName::TinyBlob => {}
BlobTypeName::MediumBlob => {}
BlobTypeName::LongBlob => {}
}
}
pub(crate) fn render_shape_signedness(node: &Signedness) {
match node {
Signedness::Unspecified => {}
Signedness::Signed => {}
Signedness::Unsigned => {}
}
}
pub(crate) fn render_shape_character_type_name(node: &CharacterTypeName) {
match node {
CharacterTypeName::Char => {}
CharacterTypeName::Character => {}
CharacterTypeName::CharVarying => {}
CharacterTypeName::CharacterVarying => {}
CharacterTypeName::Varchar => {}
CharacterTypeName::Nchar => {}
CharacterTypeName::NcharVarying => {}
CharacterTypeName::NationalChar => {}
CharacterTypeName::NationalCharVarying => {}
CharacterTypeName::NationalCharacter => {}
CharacterTypeName::NationalCharacterVarying => {}
}
}
pub(crate) fn render_shape_charset_annotation(node: &CharsetAnnotation) {
let CharsetAnnotation {
charset,
name,
binary,
meta,
} = node;
if let Some(item) = charset.as_ref() {
render_shape_charset(item);
}
if let Some(item) = name.as_ref() {
render_shape_ident(item);
}
touch(binary);
touch(meta);
}
pub(crate) fn render_shape_charset(node: &Charset) {
match node {
Charset::Named => {}
Charset::Ascii => {}
Charset::Unicode => {}
Charset::Byte => {}
}
}
pub(crate) fn render_shape_binary_type_name(node: &BinaryTypeName) {
match node {
BinaryTypeName::Binary => {}
BinaryTypeName::BinaryVarying => {}
BinaryTypeName::Varbinary => {}
BinaryTypeName::Bytea => {}
}
}
pub(crate) fn render_shape_time_type_name(node: &TimeTypeName) {
match node {
TimeTypeName::Time => {}
TimeTypeName::Timetz => {}
}
}
pub(crate) fn render_shape_timestamp_type_name(node: &TimestampTypeName) {
match node {
TimestampTypeName::Timestamp => {}
TimestampTypeName::Timestamptz => {}
TimestampTypeName::Datetime => {}
}
}
pub(crate) fn render_shape_time_zone(node: &TimeZone) {
match node {
TimeZone::Unspecified => {}
TimeZone::WithTimeZone => {}
TimeZone::WithoutTimeZone => {}
}
}
pub(crate) fn render_shape_interval_fields(node: &IntervalFields) {
match node {
IntervalFields::Year => {}
IntervalFields::Month => {}
IntervalFields::Day => {}
IntervalFields::Hour => {}
IntervalFields::Minute => {}
IntervalFields::Second => {}
IntervalFields::YearToMonth => {}
IntervalFields::DayToHour => {}
IntervalFields::DayToMinute => {}
IntervalFields::DayToSecond => {}
IntervalFields::HourToMinute => {}
IntervalFields::HourToSecond => {}
IntervalFields::MinuteToSecond => {}
IntervalFields::Week => {}
IntervalFields::Quarter => {}
IntervalFields::Decade => {}
IntervalFields::Century => {}
IntervalFields::Millennium => {}
IntervalFields::Millisecond => {}
IntervalFields::Microsecond => {}
IntervalFields::DayToMicrosecond => {}
IntervalFields::HourToMicrosecond => {}
IntervalFields::MinuteToMicrosecond => {}
IntervalFields::SecondToMicrosecond => {}
}
}
pub(crate) fn render_shape_copy_statement<X: Extension>(node: &CopyStatement<X>) {
let CopyStatement {
binary,
source,
direction,
target,
delimiters,
parenthesized,
options,
filter,
meta,
} = node;
touch(binary);
render_shape_copy_source(source);
render_shape_copy_direction(direction);
render_shape_copy_target(target);
if let Some(item) = delimiters.as_ref() {
render_shape_literal(item);
}
touch(parenthesized);
for item in options.iter() {
render_shape_copy_option(item);
}
if let Some(item) = filter.as_ref() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_copy_source<X: Extension>(node: &CopySource<X>) {
match node {
CopySource::Table {
table,
columns,
meta,
} => {
render_shape_object_name(table);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
CopySource::Query { query, meta } => {
render_shape_statement(query);
touch(meta);
}
}
}
pub(crate) fn render_shape_copy_direction(node: &CopyDirection) {
match node {
CopyDirection::From => {}
CopyDirection::To => {}
}
}
pub(crate) fn render_shape_copy_target(node: &CopyTarget) {
match node {
CopyTarget::File { path, meta } => {
render_shape_literal(path);
touch(meta);
}
CopyTarget::Stdin { meta } => {
touch(meta);
}
CopyTarget::Stdout { meta } => {
touch(meta);
}
CopyTarget::Program { command, meta } => {
render_shape_literal(command);
touch(meta);
}
}
}
pub(crate) fn render_shape_copy_option(node: &CopyOption) {
let CopyOption { name, value, meta } = node;
render_shape_ident(name);
if let Some(item) = value.as_ref() {
render_shape_copy_option_value(item);
}
touch(meta);
}
pub(crate) fn render_shape_copy_option_value(node: &CopyOptionValue) {
match node {
CopyOptionValue::Word { word, meta } => {
render_shape_ident(word);
touch(meta);
}
CopyOptionValue::String { value, meta } => {
render_shape_literal(value);
touch(meta);
}
CopyOptionValue::Number { value, meta } => {
render_shape_literal(value);
touch(meta);
}
CopyOptionValue::Star { meta } => {
touch(meta);
}
CopyOptionValue::List { values, meta } => {
for item in values.iter() {
render_shape_copy_option_value(item);
}
touch(meta);
}
CopyOptionValue::Force {
kind,
columns,
meta,
} => {
render_shape_force_kind(kind);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
CopyOptionValue::OptionList { options, meta } => {
for item in options.iter() {
render_shape_copy_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_force_kind(node: &ForceKind) {
match node {
ForceKind::Quote => {}
ForceKind::Null => {}
ForceKind::NotNull => {}
}
}
pub(crate) fn render_shape_copy_into_statement<X: Extension>(node: &CopyIntoStatement<X>) {
let CopyIntoStatement {
target,
source,
options,
meta,
} = node;
render_shape_copy_into_target(target);
render_shape_copy_into_source(source);
for item in options.iter() {
render_shape_copy_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_copy_into_target(node: &CopyIntoTarget) {
match node {
CopyIntoTarget::Table {
table,
columns,
meta,
} => {
render_shape_object_name(table);
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
CopyIntoTarget::External { location, meta } => {
render_shape_literal(location);
touch(meta);
}
CopyIntoTarget::Stage { reference, meta } => {
render_shape_ident(reference);
touch(meta);
}
}
}
pub(crate) fn render_shape_copy_into_source<X: Extension>(node: &CopyIntoSource<X>) {
match node {
CopyIntoSource::Table { table, meta } => {
render_shape_object_name(table);
touch(meta);
}
CopyIntoSource::External { location, meta } => {
render_shape_literal(location);
touch(meta);
}
CopyIntoSource::Stage { reference, meta } => {
render_shape_ident(reference);
touch(meta);
}
CopyIntoSource::Query { query, meta } => {
render_shape_statement(query);
touch(meta);
}
}
}
pub(crate) fn render_shape_export_statement(node: &ExportStatement) {
let ExportStatement {
database,
path,
parenthesized,
options,
meta,
} = node;
if let Some(item) = database.as_ref() {
render_shape_ident(item);
}
render_shape_literal(path);
touch(parenthesized);
for item in options.iter() {
render_shape_copy_option(item);
}
touch(meta);
}
pub(crate) fn render_shape_import_statement(node: &ImportStatement) {
let ImportStatement { path, meta } = node;
render_shape_literal(path);
touch(meta);
}
pub(crate) fn render_shape_explain_statement<X: Extension>(node: &ExplainStatement<X>) {
let ExplainStatement {
spelling,
parenthesized,
options,
statement,
meta,
} = node;
render_shape_explain_keyword(spelling);
touch(parenthesized);
for item in options.iter() {
render_shape_explain_option(item);
}
render_shape_statement(statement);
touch(meta);
}
pub(crate) fn render_shape_explain_option(node: &ExplainOption) {
match node {
ExplainOption::Analyze { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
ExplainOption::Verbose { value, meta } => {
if let Some(item) = value.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
ExplainOption::Format { format, meta } => {
render_shape_explain_format(format);
touch(meta);
}
ExplainOption::Other { name, value, meta } => {
render_shape_ident(name);
if let Some(item) = value.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_explain_format(node: &ExplainFormat) {
match node {
ExplainFormat::Text => {}
ExplainFormat::Xml => {}
ExplainFormat::Json => {}
ExplainFormat::Yaml => {}
}
}
pub(crate) fn render_shape_explain_keyword(node: &ExplainKeyword) {
match node {
ExplainKeyword::Explain => {}
ExplainKeyword::Describe => {}
ExplainKeyword::Desc => {}
}
}
pub(crate) fn render_shape_describe_statement(node: &DescribeStatement) {
let DescribeStatement {
keyword,
table,
column,
meta,
} = node;
render_shape_explain_keyword(keyword);
render_shape_object_name(table);
if let Some(item) = column.as_ref() {
render_shape_describe_column(item);
}
touch(meta);
}
pub(crate) fn render_shape_describe_column(node: &DescribeColumn) {
match node {
DescribeColumn::Name { name, meta } => {
render_shape_ident(name);
touch(meta);
}
DescribeColumn::Wild { pattern, meta } => {
render_shape_literal(pattern);
touch(meta);
}
}
}
pub(crate) fn render_shape_kill_statement<X: Extension>(node: &KillStatement<X>) {
let KillStatement { target, id, meta } = node;
render_shape_kill_target(target);
render_shape_expr(id);
touch(meta);
}
pub(crate) fn render_shape_kill_target(node: &KillTarget) {
match node {
KillTarget::Unspecified => {}
KillTarget::Connection => {}
KillTarget::Query => {}
}
}
pub(crate) fn render_shape_install_statement<X: Extension>(node: &InstallStatement<X>) {
match node {
InstallStatement::Plugin { name, soname, meta } => {
render_shape_ident(name);
render_shape_literal(soname);
touch(meta);
}
InstallStatement::Component { urns, set, meta } => {
for item in urns.iter() {
render_shape_literal(item);
}
for item in set.iter() {
render_shape_install_component_set_element(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_uninstall_statement(node: &UninstallStatement) {
match node {
UninstallStatement::Plugin { name, meta } => {
render_shape_ident(name);
touch(meta);
}
UninstallStatement::Component { urns, meta } => {
for item in urns.iter() {
render_shape_literal(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_install_component_set_element<X: Extension>(
node: &InstallComponentSetElement<X>,
) {
let InstallComponentSetElement {
scope,
name,
assignment,
value,
meta,
} = node;
if let Some(item) = scope.as_ref() {
render_shape_install_component_set_scope(item);
}
render_shape_object_name(name);
render_shape_set_assignment(assignment);
render_shape_install_component_set_value(value);
touch(meta);
}
pub(crate) fn render_shape_install_component_set_scope(node: &InstallComponentSetScope) {
match node {
InstallComponentSetScope::Global => {}
InstallComponentSetScope::Persist => {}
}
}
pub(crate) fn render_shape_install_component_set_value<X: Extension>(
node: &InstallComponentSetValue<X>,
) {
match node {
InstallComponentSetValue::On { meta } => {
touch(meta);
}
InstallComponentSetValue::Expr { expr, meta } => {
render_shape_expr(expr);
touch(meta);
}
}
}
pub(crate) fn render_shape_handler_statement<X: Extension>(node: &HandlerStatement<X>) {
let HandlerStatement {
table,
operation,
meta,
} = node;
render_shape_object_name(table);
render_shape_handler_operation(operation);
touch(meta);
}
pub(crate) fn render_shape_handler_operation<X: Extension>(node: &HandlerOperation<X>) {
match node {
HandlerOperation::Open {
alias,
as_keyword,
meta,
} => {
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
touch(as_keyword);
touch(meta);
}
HandlerOperation::Close { meta } => {
touch(meta);
}
HandlerOperation::Read {
selector,
selection,
limit,
meta,
} => {
render_shape_handler_read_selector(selector);
if let Some(item) = selection.as_ref() {
render_shape_expr(item);
}
if let Some(item) = limit.as_ref() {
render_shape_limit(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_handler_read_selector<X: Extension>(node: &HandlerReadSelector<X>) {
match node {
HandlerReadSelector::Scan { direction, meta } => {
render_shape_handler_scan_direction(direction);
touch(meta);
}
HandlerReadSelector::Index {
index,
direction,
meta,
} => {
render_shape_ident(index);
render_shape_handler_index_direction(direction);
touch(meta);
}
HandlerReadSelector::Key {
index,
comparison,
key,
meta,
} => {
render_shape_ident(index);
render_shape_handler_key_comparison(comparison);
for item in key.iter() {
render_shape_values_item(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_handler_scan_direction(node: &HandlerScanDirection) {
match node {
HandlerScanDirection::First => {}
HandlerScanDirection::Next => {}
}
}
pub(crate) fn render_shape_handler_index_direction(node: &HandlerIndexDirection) {
match node {
HandlerIndexDirection::First => {}
HandlerIndexDirection::Next => {}
HandlerIndexDirection::Prev => {}
HandlerIndexDirection::Last => {}
}
}
pub(crate) fn render_shape_handler_key_comparison(node: &HandlerKeyComparison) {
match node {
HandlerKeyComparison::Eq => {}
HandlerKeyComparison::GreaterOrEqual => {}
HandlerKeyComparison::LessOrEqual => {}
HandlerKeyComparison::Greater => {}
HandlerKeyComparison::Less => {}
}
}
pub(crate) fn render_shape_clone_statement(node: &CloneStatement) {
match node {
CloneStatement::Local {
data_directory,
meta,
} => {
render_shape_clone_data_directory(data_directory);
touch(meta);
}
CloneStatement::Instance {
source,
port,
password,
data_directory,
ssl,
meta,
} => {
render_shape_account_name(source);
render_shape_literal(port);
render_shape_literal(password);
if let Some(item) = data_directory.as_ref() {
render_shape_clone_data_directory(item);
}
render_shape_clone_ssl(ssl);
touch(meta);
}
}
}
pub(crate) fn render_shape_clone_data_directory(node: &CloneDataDirectory) {
let CloneDataDirectory { equals, path, meta } = node;
touch(equals);
render_shape_literal(path);
touch(meta);
}
pub(crate) fn render_shape_clone_ssl(node: &CloneSsl) {
match node {
CloneSsl::Unspecified => {}
CloneSsl::Require => {}
CloneSsl::RequireNo => {}
}
}
pub(crate) fn render_shape_import_table_statement(node: &ImportTableStatement) {
let ImportTableStatement { files, meta } = node;
for item in files.iter() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_help_statement(node: &HelpStatement) {
let HelpStatement { topic, meta } = node;
render_shape_ident(topic);
touch(meta);
}
pub(crate) fn render_shape_binlog_statement(node: &BinlogStatement) {
let BinlogStatement { event, meta } = node;
render_shape_literal(event);
touch(meta);
}
pub(crate) fn render_shape_pragma_statement(node: &PragmaStatement) {
let PragmaStatement {
name,
value,
parenthesized,
meta,
} = node;
render_shape_object_name(name);
if let Some(item) = value.as_ref() {
render_shape_set_parameter_value(item);
}
touch(parenthesized);
touch(meta);
}
pub(crate) fn render_shape_attach_statement<X: Extension>(node: &AttachStatement<X>) {
let AttachStatement {
database_keyword,
target,
schema,
meta,
} = node;
touch(database_keyword);
render_shape_expr(target);
render_shape_ident(schema);
touch(meta);
}
pub(crate) fn render_shape_detach_statement(node: &DetachStatement) {
let DetachStatement {
database_keyword,
if_exists,
schema,
meta,
} = node;
touch(database_keyword);
touch(if_exists);
render_shape_ident(schema);
touch(meta);
}
pub(crate) fn render_shape_checkpoint_statement(node: &CheckpointStatement) {
let CheckpointStatement {
force,
database,
meta,
} = node;
touch(force);
if let Some(item) = database.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_load_statement(node: &LoadStatement) {
let LoadStatement { target, meta } = node;
render_shape_load_target(target);
touch(meta);
}
pub(crate) fn render_shape_load_target(node: &LoadTarget) {
match node {
LoadTarget::Name { name, meta } => {
render_shape_ident(name);
touch(meta);
}
LoadTarget::Path { path, meta } => {
render_shape_literal(path);
touch(meta);
}
}
}
pub(crate) fn render_shape_update_extensions_statement(node: &UpdateExtensionsStatement) {
let UpdateExtensionsStatement { extensions, meta } = node;
for item in extensions.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_vacuum_statement<X: Extension>(node: &VacuumStatement<X>) {
let VacuumStatement {
schema,
into,
analyze,
table,
columns,
meta,
} = node;
if let Some(item) = schema.as_ref() {
render_shape_ident(item);
}
if let Some(item) = into.as_ref() {
render_shape_expr(item);
}
if let Some(item) = analyze.as_ref() {
render_shape_vacuum_analyze(item);
}
if let Some(item) = table.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = columns.as_ref() {
for item1 in item.iter() {
render_shape_ident(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_vacuum_analyze(node: &VacuumAnalyze) {
match node {
VacuumAnalyze::Keyword => {}
VacuumAnalyze::Parenthesized => {}
}
}
pub(crate) fn render_shape_reindex_statement(node: &ReindexStatement) {
let ReindexStatement { target, meta } = node;
if let Some(item) = target.as_ref() {
render_shape_object_name(item);
}
touch(meta);
}
pub(crate) fn render_shape_analyze_statement(node: &AnalyzeStatement) {
let AnalyzeStatement {
target,
columns,
meta,
} = node;
if let Some(item) = target.as_ref() {
render_shape_object_name(item);
}
if let Some(item) = columns.as_ref() {
for item1 in item.iter() {
render_shape_ident(item1);
}
}
touch(meta);
}
pub(crate) fn render_shape_table_maintenance_statement(node: &TableMaintenanceStatement) {
let TableMaintenanceStatement {
kind,
table_keyword,
tables,
meta,
} = node;
render_shape_table_maintenance_kind(kind);
render_shape_table_keyword(table_keyword);
for item in tables.iter() {
render_shape_object_name(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_maintenance_kind(node: &TableMaintenanceKind) {
match node {
TableMaintenanceKind::Analyze {
no_write_to_binlog,
histogram,
meta,
} => {
if let Some(item) = no_write_to_binlog.as_ref() {
render_shape_no_write_to_binlog(item);
}
if let Some(item) = histogram.as_ref() {
render_shape_analyze_histogram(item);
}
touch(meta);
}
TableMaintenanceKind::Check { options, meta } => {
for item in options.iter() {
render_shape_check_table_option(item);
}
touch(meta);
}
TableMaintenanceKind::Checksum { option, meta } => {
if let Some(item) = option.as_ref() {
render_shape_checksum_table_option(item);
}
touch(meta);
}
TableMaintenanceKind::Optimize {
no_write_to_binlog,
meta,
} => {
if let Some(item) = no_write_to_binlog.as_ref() {
render_shape_no_write_to_binlog(item);
}
touch(meta);
}
TableMaintenanceKind::Repair {
no_write_to_binlog,
options,
meta,
} => {
if let Some(item) = no_write_to_binlog.as_ref() {
render_shape_no_write_to_binlog(item);
}
for item in options.iter() {
render_shape_repair_table_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_table_keyword(node: &TableKeyword) {
match node {
TableKeyword::Table => {}
TableKeyword::Tables => {}
}
}
pub(crate) fn render_shape_no_write_to_binlog(node: &NoWriteToBinlog) {
match node {
NoWriteToBinlog::NoWriteToBinlog => {}
NoWriteToBinlog::Local => {}
}
}
pub(crate) fn render_shape_analyze_histogram(node: &AnalyzeHistogram) {
match node {
AnalyzeHistogram::Update {
columns,
buckets,
meta,
} => {
for item in columns.iter() {
render_shape_ident(item);
}
if let Some(item) = buckets.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
AnalyzeHistogram::Drop { columns, meta } => {
for item in columns.iter() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_check_table_option(node: &CheckTableOption) {
match node {
CheckTableOption::ForUpgrade => {}
CheckTableOption::Quick => {}
CheckTableOption::Fast => {}
CheckTableOption::Medium => {}
CheckTableOption::Extended => {}
CheckTableOption::Changed => {}
}
}
pub(crate) fn render_shape_checksum_table_option(node: &ChecksumTableOption) {
match node {
ChecksumTableOption::Quick => {}
ChecksumTableOption::Extended => {}
}
}
pub(crate) fn render_shape_repair_table_option(node: &RepairTableOption) {
match node {
RepairTableOption::Quick => {}
RepairTableOption::Extended => {}
RepairTableOption::UseFrm => {}
}
}
pub(crate) fn render_shape_cache_index_statement(node: &CacheIndexStatement) {
let CacheIndexStatement {
targets,
cache,
meta,
} = node;
render_shape_cache_index_targets(targets);
render_shape_key_cache_name(cache);
touch(meta);
}
pub(crate) fn render_shape_cache_index_targets(node: &CacheIndexTargets) {
match node {
CacheIndexTargets::Tables { tables, meta } => {
for item in tables.iter() {
render_shape_cache_index_table(item);
}
touch(meta);
}
CacheIndexTargets::Partition {
table,
partition,
keys,
meta,
} => {
render_shape_object_name(table);
render_shape_partition_selection(partition);
if let Some(item) = keys.as_ref() {
render_shape_cache_index_key_list(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_cache_index_table(node: &CacheIndexTable) {
let CacheIndexTable { table, keys, meta } = node;
render_shape_object_name(table);
if let Some(item) = keys.as_ref() {
render_shape_cache_index_key_list(item);
}
touch(meta);
}
pub(crate) fn render_shape_load_index_statement(node: &LoadIndexStatement) {
let LoadIndexStatement { targets, meta } = node;
render_shape_load_index_targets(targets);
touch(meta);
}
pub(crate) fn render_shape_load_index_targets(node: &LoadIndexTargets) {
match node {
LoadIndexTargets::Tables { tables, meta } => {
for item in tables.iter() {
render_shape_load_index_table(item);
}
touch(meta);
}
LoadIndexTargets::Partition {
table,
partition,
keys,
ignore_leaves,
meta,
} => {
render_shape_object_name(table);
render_shape_partition_selection(partition);
if let Some(item) = keys.as_ref() {
render_shape_cache_index_key_list(item);
}
touch(ignore_leaves);
touch(meta);
}
}
}
pub(crate) fn render_shape_load_index_table(node: &LoadIndexTable) {
let LoadIndexTable {
table,
keys,
ignore_leaves,
meta,
} = node;
render_shape_object_name(table);
if let Some(item) = keys.as_ref() {
render_shape_cache_index_key_list(item);
}
touch(ignore_leaves);
touch(meta);
}
pub(crate) fn render_shape_cache_index_key_list(node: &CacheIndexKeyList) {
let CacheIndexKeyList {
keyword,
keys,
meta,
} = node;
render_shape_cache_index_keyword(keyword);
for item in keys.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_cache_index_keyword(node: &CacheIndexKeyword) {
match node {
CacheIndexKeyword::Index => {}
CacheIndexKeyword::Key => {}
}
}
pub(crate) fn render_shape_key_cache_name(node: &KeyCacheName) {
match node {
KeyCacheName::Named { name, meta } => {
render_shape_ident(name);
touch(meta);
}
KeyCacheName::Default { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_partition_selection(node: &PartitionSelection) {
match node {
PartitionSelection::All { meta } => {
touch(meta);
}
PartitionSelection::Names { names, meta } => {
for item in names.iter() {
render_shape_ident(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_rename_statement(node: &RenameStatement) {
match node {
RenameStatement::Table {
table_keyword,
renames,
meta,
} => {
render_shape_table_keyword(table_keyword);
for item in renames.iter() {
render_shape_table_rename(item);
}
touch(meta);
}
RenameStatement::User { renames, meta } => {
for item in renames.iter() {
render_shape_user_rename(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_table_rename(node: &TableRename) {
let TableRename { from, to, meta } = node;
render_shape_object_name(from);
render_shape_object_name(to);
touch(meta);
}
pub(crate) fn render_shape_user_rename(node: &UserRename) {
let UserRename { from, to, meta } = node;
render_shape_account_name(from);
render_shape_account_name(to);
touch(meta);
}
pub(crate) fn render_shape_account_name(node: &AccountName) {
match node {
AccountName::Account { user, host, meta } => {
render_shape_ident(user);
if let Some(item) = host.as_ref() {
render_shape_ident(item);
}
touch(meta);
}
AccountName::CurrentUser { parens, meta } => {
touch(parens);
touch(meta);
}
}
}
pub(crate) fn render_shape_flush_statement(node: &FlushStatement) {
let FlushStatement {
no_write_to_binlog,
target,
meta,
} = node;
if let Some(item) = no_write_to_binlog.as_ref() {
render_shape_no_write_to_binlog(item);
}
render_shape_flush_target(target);
touch(meta);
}
pub(crate) fn render_shape_flush_target(node: &FlushTarget) {
match node {
FlushTarget::Tables {
table_keyword,
tables,
lock,
meta,
} => {
render_shape_table_keyword(table_keyword);
for item in tables.iter() {
render_shape_object_name(item);
}
if let Some(item) = lock.as_ref() {
render_shape_flush_tables_lock(item);
}
touch(meta);
}
FlushTarget::Options { options, meta } => {
for item in options.iter() {
render_shape_flush_option(item);
}
touch(meta);
}
}
}
pub(crate) fn render_shape_flush_tables_lock(node: &FlushTablesLock) {
match node {
FlushTablesLock::WithReadLock => {}
FlushTablesLock::ForExport => {}
}
}
pub(crate) fn render_shape_flush_option(node: &FlushOption) {
match node {
FlushOption::Privileges { meta } => {
touch(meta);
}
FlushOption::Logs { meta } => {
touch(meta);
}
FlushOption::BinaryLogs { meta } => {
touch(meta);
}
FlushOption::EngineLogs { meta } => {
touch(meta);
}
FlushOption::ErrorLogs { meta } => {
touch(meta);
}
FlushOption::GeneralLogs { meta } => {
touch(meta);
}
FlushOption::SlowLogs { meta } => {
touch(meta);
}
FlushOption::RelayLogs { channel, meta } => {
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
FlushOption::Status { meta } => {
touch(meta);
}
FlushOption::UserResources { meta } => {
touch(meta);
}
FlushOption::OptimizerCosts { meta } => {
touch(meta);
}
}
}
pub(crate) fn render_shape_purge_statement<X: Extension>(node: &PurgeStatement<X>) {
let PurgeStatement { target, meta } = node;
render_shape_purge_target(target);
touch(meta);
}
pub(crate) fn render_shape_purge_target<X: Extension>(node: &PurgeTarget<X>) {
match node {
PurgeTarget::To { log, meta } => {
render_shape_literal(log);
touch(meta);
}
PurgeTarget::Before { datetime, meta } => {
render_shape_expr(datetime);
touch(meta);
}
}
}
pub(crate) fn render_shape_use_statement(node: &UseStatement) {
let UseStatement { name, meta } = node;
render_shape_object_name(name);
touch(meta);
}
pub(crate) fn render_shape_prepare_statement<X: Extension>(node: &PrepareStatement<X>) {
let PrepareStatement {
name,
parameter_types,
statement,
meta,
} = node;
render_shape_ident(name);
for item in parameter_types.iter() {
render_shape_data_type(item);
}
render_shape_statement(statement);
touch(meta);
}
pub(crate) fn render_shape_prepare_from_statement(node: &PrepareFromStatement) {
let PrepareFromStatement { name, source, meta } = node;
render_shape_ident(name);
render_shape_prepare_source(source);
touch(meta);
}
pub(crate) fn render_shape_prepare_source(node: &PrepareSource) {
match node {
PrepareSource::Text { source, meta } => {
render_shape_literal(source);
touch(meta);
}
PrepareSource::Variable { name, meta } => {
render_shape_ident(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_execute_statement<X: Extension>(node: &ExecuteStatement<X>) {
let ExecuteStatement { name, args, meta } = node;
render_shape_ident(name);
for item in args.iter() {
render_shape_expr(item);
}
touch(meta);
}
pub(crate) fn render_shape_execute_using_statement(node: &ExecuteUsingStatement) {
let ExecuteUsingStatement { name, using, meta } = node;
render_shape_ident(name);
for item in using.iter() {
render_shape_ident(item);
}
touch(meta);
}
pub(crate) fn render_shape_call_statement<X: Extension>(node: &CallStatement<X>) {
let CallStatement {
name,
args,
parenthesized,
meta,
} = node;
render_shape_object_name(name);
for item in args.iter() {
render_shape_expr(item);
}
touch(parenthesized);
touch(meta);
}
pub(crate) fn render_shape_deallocate_statement(node: &DeallocateStatement) {
let DeallocateStatement {
keyword,
prepare_keyword,
name,
meta,
} = node;
render_shape_deallocate_keyword(keyword);
touch(prepare_keyword);
render_shape_ident(name);
touch(meta);
}
pub(crate) fn render_shape_deallocate_keyword(node: &DeallocateKeyword) {
match node {
DeallocateKeyword::Deallocate => {}
DeallocateKeyword::Drop => {}
}
}
pub(crate) fn render_shape_do_statement(node: &DoStatement) {
let DoStatement { args, meta } = node;
for item in args.iter() {
render_shape_do_arg(item);
}
touch(meta);
}
pub(crate) fn render_shape_do_arg(node: &DoArg) {
match node {
DoArg::Body { body, meta } => {
render_shape_literal(body);
touch(meta);
}
DoArg::Language { name, meta } => {
render_shape_language_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_language_name(node: &LanguageName) {
match node {
LanguageName::Word { word, meta } => {
render_shape_ident(word);
touch(meta);
}
LanguageName::String { value, meta } => {
render_shape_literal(value);
touch(meta);
}
}
}
pub(crate) fn render_shape_do_expressions_statement<X: Extension>(
node: &DoExpressionsStatement<X>,
) {
let DoExpressionsStatement { items, meta } = node;
for item in items.iter() {
render_shape_select_item(item);
}
touch(meta);
}
pub(crate) fn render_shape_lock_tables_statement(node: &LockTablesStatement) {
let LockTablesStatement {
plural,
tables,
meta,
} = node;
touch(plural);
for item in tables.iter() {
render_shape_table_lock(item);
}
touch(meta);
}
pub(crate) fn render_shape_table_lock(node: &TableLock) {
let TableLock {
name,
alias,
kind,
meta,
} = node;
render_shape_object_name(name);
if let Some(item) = alias.as_ref() {
render_shape_ident(item);
}
render_shape_table_lock_kind(kind);
touch(meta);
}
pub(crate) fn render_shape_table_lock_kind(node: &TableLockKind) {
match node {
TableLockKind::Read => {}
TableLockKind::ReadLocal => {}
TableLockKind::Write => {}
}
}
pub(crate) fn render_shape_unlock_tables_statement(node: &UnlockTablesStatement) {
let UnlockTablesStatement { plural, meta } = node;
touch(plural);
touch(meta);
}
pub(crate) fn render_shape_instance_lock_statement(node: &InstanceLockStatement) {
let InstanceLockStatement { acquire, meta } = node;
touch(acquire);
touch(meta);
}
pub(crate) fn render_shape_load_data_statement<X: Extension>(node: &LoadDataStatement<X>) {
let LoadDataStatement {
format,
concurrency,
local,
file,
on_duplicate,
table,
partitions,
charset,
rows_identified_by,
fields,
lines,
ignore_rows,
columns,
set,
meta,
} = node;
render_shape_load_data_format(format);
if let Some(item) = concurrency.as_ref() {
render_shape_load_data_concurrency(item);
}
touch(local);
render_shape_literal(file);
if let Some(item) = on_duplicate.as_ref() {
render_shape_load_data_duplicate(item);
}
render_shape_object_name(table);
for item in partitions.iter() {
render_shape_ident(item);
}
if let Some(item) = charset.as_ref() {
render_shape_ident(item);
}
if let Some(item) = rows_identified_by.as_ref() {
render_shape_literal(item);
}
if let Some(item) = fields.as_ref() {
render_shape_load_data_fields(item);
}
if let Some(item) = lines.as_ref() {
render_shape_load_data_lines(item);
}
if let Some(item) = ignore_rows.as_ref() {
render_shape_load_data_ignore_rows(item);
}
for item in columns.iter() {
render_shape_load_data_field_or_var(item);
}
for item in set.iter() {
render_shape_update_assignment(item);
}
touch(meta);
}
pub(crate) fn render_shape_load_data_format(node: &LoadDataFormat) {
match node {
LoadDataFormat::Data => {}
LoadDataFormat::Xml => {}
}
}
pub(crate) fn render_shape_load_data_concurrency(node: &LoadDataConcurrency) {
match node {
LoadDataConcurrency::LowPriority => {}
LoadDataConcurrency::Concurrent => {}
}
}
pub(crate) fn render_shape_load_data_duplicate(node: &LoadDataDuplicate) {
match node {
LoadDataDuplicate::Replace => {}
LoadDataDuplicate::Ignore => {}
}
}
pub(crate) fn render_shape_load_data_fields(node: &LoadDataFields) {
let LoadDataFields {
spelling,
terminated_by,
enclosed_by,
escaped_by,
meta,
} = node;
render_shape_load_fields_spelling(spelling);
if let Some(item) = terminated_by.as_ref() {
render_shape_literal(item);
}
if let Some(item) = enclosed_by.as_ref() {
render_shape_load_data_enclosed(item);
}
if let Some(item) = escaped_by.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_load_fields_spelling(node: &LoadFieldsSpelling) {
match node {
LoadFieldsSpelling::Fields => {}
LoadFieldsSpelling::Columns => {}
}
}
pub(crate) fn render_shape_load_data_enclosed(node: &LoadDataEnclosed) {
let LoadDataEnclosed {
optionally,
value,
meta,
} = node;
touch(optionally);
render_shape_literal(value);
touch(meta);
}
pub(crate) fn render_shape_load_data_lines(node: &LoadDataLines) {
let LoadDataLines {
starting_by,
terminated_by,
meta,
} = node;
if let Some(item) = starting_by.as_ref() {
render_shape_literal(item);
}
if let Some(item) = terminated_by.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
pub(crate) fn render_shape_load_data_ignore_rows(node: &LoadDataIgnoreRows) {
let LoadDataIgnoreRows { count, unit, meta } = node;
render_shape_literal(count);
render_shape_load_data_ignore_unit(unit);
touch(meta);
}
pub(crate) fn render_shape_load_data_ignore_unit(node: &LoadDataIgnoreUnit) {
match node {
LoadDataIgnoreUnit::Lines => {}
LoadDataIgnoreUnit::Rows => {}
}
}
pub(crate) fn render_shape_load_data_field_or_var(node: &LoadDataFieldOrVar) {
match node {
LoadDataFieldOrVar::Column { name, meta } => {
render_shape_ident(name);
touch(meta);
}
LoadDataFieldOrVar::Variable { name, meta } => {
render_shape_ident(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_show_statement<X: Extension>(node: &ShowStatement<X>) {
let ShowStatement { target, meta } = node;
render_shape_show_target(target);
touch(meta);
}
pub(crate) fn render_shape_show_target<X: Extension>(node: &ShowTarget<X>) {
match node {
ShowTarget::Tables {
extended,
full,
all,
from,
filter,
meta,
} => {
touch(extended);
touch(full);
touch(all);
if let Some(item) = from.as_ref() {
render_shape_show_from(item);
}
if let Some(item) = filter.as_ref() {
render_shape_show_filter(item);
}
touch(meta);
}
ShowTarget::Columns {
extended,
full,
spelling,
table,
database,
filter,
meta,
} => {
touch(extended);
touch(full);
render_shape_show_columns_spelling(spelling);
render_shape_show_from(table);
if let Some(item) = database.as_ref() {
render_shape_show_from(item);
}
if let Some(item) = filter.as_ref() {
render_shape_show_filter(item);
}
touch(meta);
}
ShowTarget::Create {
kind,
name,
if_not_exists,
meta,
} => {
render_shape_show_create_kind(kind);
render_shape_object_name(name);
touch(if_not_exists);
touch(meta);
}
ShowTarget::Functions {
kind,
from,
filter,
meta,
} => {
if let Some(item) = kind.as_ref() {
render_shape_show_functions_scope(item);
}
if let Some(item) = from.as_ref() {
render_shape_show_from(item);
}
if let Some(item) = filter.as_ref() {
render_shape_show_functions_filter(item);
}
touch(meta);
}
ShowTarget::RoutineStatus { kind, filter, meta } => {
render_shape_show_routine_kind(kind);
if let Some(item) = filter.as_ref() {
render_shape_show_filter(item);
}
touch(meta);
}
ShowTarget::Listing {
kind,
from,
filter,
meta,
} => {
render_shape_show_listing(kind);
if let Some(item) = from.as_ref() {
render_shape_show_from(item);
}
if let Some(item) = filter.as_ref() {
render_shape_show_filter(item);
}
touch(meta);
}
ShowTarget::Bare { kind, meta } => {
render_shape_show_bare(kind);
touch(meta);
}
ShowTarget::Grants {
user,
using_roles,
meta,
} => {
if let Some(item) = user.as_ref() {
render_shape_account_name(item);
}
for item in using_roles.iter() {
render_shape_account_name(item);
}
touch(meta);
}
ShowTarget::CreateUser { user, meta } => {
render_shape_account_name(user);
touch(meta);
}
ShowTarget::Profile {
types,
query,
limit,
meta,
} => {
for item in types.iter() {
render_shape_show_profile_type(item);
}
if let Some(item) = query.as_ref() {
render_shape_literal(item);
}
if let Some(item) = limit.as_ref() {
render_shape_show_limit(item);
}
touch(meta);
}
ShowTarget::LogEvents {
relay,
log_name,
position,
limit,
channel,
meta,
} => {
touch(relay);
if let Some(item) = log_name.as_ref() {
render_shape_literal(item);
}
if let Some(item) = position.as_ref() {
render_shape_literal(item);
}
if let Some(item) = limit.as_ref() {
render_shape_show_limit(item);
}
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ShowTarget::Index {
spelling,
extended,
table,
database,
filter,
meta,
} => {
render_shape_show_index_spelling(spelling);
touch(extended);
render_shape_show_from(table);
if let Some(item) = database.as_ref() {
render_shape_show_from(item);
}
if let Some(item) = filter.as_ref() {
render_shape_show_filter(item);
}
touch(meta);
}
ShowTarget::Engine {
engine,
artifact,
meta,
} => {
if let Some(item) = engine.as_ref() {
render_shape_ident(item);
}
render_shape_show_engine_artifact(artifact);
touch(meta);
}
ShowTarget::ReplicaStatus { channel, meta } => {
if let Some(item) = channel.as_ref() {
render_shape_literal(item);
}
touch(meta);
}
ShowTarget::Diagnostics {
kind,
count,
limit,
meta,
} => {
render_shape_show_diagnostic_kind(kind);
touch(count);
if let Some(item) = limit.as_ref() {
render_shape_show_limit(item);
}
touch(meta);
}
ShowTarget::RoutineCode { kind, name, meta } => {
render_shape_show_routine_kind(kind);
render_shape_object_name(name);
touch(meta);
}
}
}
pub(crate) fn render_shape_show_routine_kind(node: &ShowRoutineKind) {
match node {
ShowRoutineKind::Function => {}
ShowRoutineKind::Procedure => {}
}
}
pub(crate) fn render_shape_show_functions_scope(node: &ShowFunctionsScope) {
match node {
ShowFunctionsScope::User => {}
ShowFunctionsScope::System => {}
ShowFunctionsScope::All => {}
}
}
pub(crate) fn render_shape_show_functions_filter(node: &ShowFunctionsFilter) {
match node {
ShowFunctionsFilter::Name { like, name, meta } => {
touch(like);
render_shape_object_name(name);
touch(meta);
}
ShowFunctionsFilter::Regex {
like,
pattern,
meta,
} => {
touch(like);
render_shape_literal(pattern);
touch(meta);
}
}
}
pub(crate) fn render_shape_show_columns_spelling(node: &ShowColumnsSpelling) {
match node {
ShowColumnsSpelling::Columns => {}
ShowColumnsSpelling::Fields => {}
}
}
pub(crate) fn render_shape_show_from(node: &ShowFrom) {
let ShowFrom {
keyword,
name,
meta,
} = node;
render_shape_show_from_keyword(keyword);
render_shape_object_name(name);
touch(meta);
}
pub(crate) fn render_shape_show_from_keyword(node: &ShowFromKeyword) {
match node {
ShowFromKeyword::From => {}
ShowFromKeyword::In => {}
}
}
pub(crate) fn render_shape_show_filter<X: Extension>(node: &ShowFilter<X>) {
match node {
ShowFilter::Like { pattern, meta } => {
render_shape_literal(pattern);
touch(meta);
}
ShowFilter::Where { predicate, meta } => {
render_shape_expr(predicate);
touch(meta);
}
}
}
pub(crate) fn render_shape_show_create_kind(node: &ShowCreateKind) {
match node {
ShowCreateKind::Table => {}
ShowCreateKind::View => {}
ShowCreateKind::Database { schema } => {
touch(schema);
}
ShowCreateKind::Event => {}
ShowCreateKind::Procedure => {}
ShowCreateKind::Function => {}
ShowCreateKind::Trigger => {}
}
}
pub(crate) fn render_shape_show_listing(node: &ShowListing) {
match node {
ShowListing::Databases { schemas } => {
touch(schemas);
}
ShowListing::CharacterSet { charset } => {
touch(charset);
}
ShowListing::Collation => {}
ShowListing::Status { scope } => {
if let Some(item) = scope.as_ref() {
render_shape_show_scope(item);
}
}
ShowListing::Variables { scope } => {
if let Some(item) = scope.as_ref() {
render_shape_show_scope(item);
}
}
ShowListing::Events => {}
ShowListing::TableStatus => {}
ShowListing::OpenTables => {}
ShowListing::Triggers { full } => {
touch(full);
}
}
}
pub(crate) fn render_shape_show_scope(node: &ShowScope) {
match node {
ShowScope::Global => {}
ShowScope::Session => {}
ShowScope::Local => {}
}
}
pub(crate) fn render_shape_show_bare(node: &ShowBare) {
match node {
ShowBare::Plugins => {}
ShowBare::Engines { storage } => {
touch(storage);
}
ShowBare::Privileges => {}
ShowBare::Profiles => {}
ShowBare::Processlist { full } => {
touch(full);
}
ShowBare::BinaryLogs => {}
ShowBare::Replicas => {}
ShowBare::BinaryLogStatus => {}
}
}
pub(crate) fn render_shape_show_index_spelling(node: &ShowIndexSpelling) {
match node {
ShowIndexSpelling::Index => {}
ShowIndexSpelling::Indexes => {}
ShowIndexSpelling::Keys => {}
}
}
pub(crate) fn render_shape_show_engine_artifact(node: &ShowEngineArtifact) {
match node {
ShowEngineArtifact::Status => {}
ShowEngineArtifact::Mutex => {}
ShowEngineArtifact::Logs => {}
}
}
pub(crate) fn render_shape_show_diagnostic_kind(node: &ShowDiagnosticKind) {
match node {
ShowDiagnosticKind::Warnings => {}
ShowDiagnosticKind::Errors => {}
}
}
pub(crate) fn render_shape_show_profile_type(node: &ShowProfileType) {
match node {
ShowProfileType::All => {}
ShowProfileType::BlockIo => {}
ShowProfileType::ContextSwitches => {}
ShowProfileType::Cpu => {}
ShowProfileType::Ipc => {}
ShowProfileType::Memory => {}
ShowProfileType::PageFaults => {}
ShowProfileType::Source => {}
ShowProfileType::Swaps => {}
}
}
pub(crate) fn render_shape_show_limit(node: &ShowLimit) {
let ShowLimit {
offset,
offset_keyword,
row_count,
meta,
} = node;
if let Some(item) = offset.as_ref() {
render_shape_literal(item);
}
touch(offset_keyword);
render_shape_literal(row_count);
touch(meta);
}
pub(crate) fn render_shape_window_spec<X: Extension>(node: &WindowSpec<X>) {
match node {
WindowSpec::Named { name, meta } => {
render_shape_ident(name);
touch(meta);
}
WindowSpec::Inline { definition, meta } => {
render_shape_window_definition(definition);
touch(meta);
}
}
}
pub(crate) fn render_shape_window_definition<X: Extension>(node: &WindowDefinition<X>) {
let WindowDefinition {
existing,
partition_by,
order_by,
frame,
meta,
} = node;
if let Some(item) = existing.as_ref() {
render_shape_ident(item);
}
for item in partition_by.iter() {
render_shape_expr(item);
}
for item in order_by.iter() {
render_shape_order_by_expr(item);
}
if let Some(item) = frame.as_ref() {
render_shape_window_frame(item);
}
touch(meta);
}
pub(crate) fn render_shape_window_frame<X: Extension>(node: &WindowFrame<X>) {
let WindowFrame {
units,
start,
end,
exclusion,
meta,
} = node;
render_shape_window_frame_units(units);
render_shape_window_frame_bound(start);
if let Some(item) = end.as_ref() {
render_shape_window_frame_bound(item);
}
if let Some(item) = exclusion.as_ref() {
render_shape_window_frame_exclusion(item);
}
touch(meta);
}
pub(crate) fn render_shape_window_frame_units(node: &WindowFrameUnits) {
match node {
WindowFrameUnits::Rows => {}
WindowFrameUnits::Range => {}
WindowFrameUnits::Groups => {}
}
}
pub(crate) fn render_shape_window_frame_bound<X: Extension>(node: &WindowFrameBound<X>) {
match node {
WindowFrameBound::CurrentRow { meta } => {
touch(meta);
}
WindowFrameBound::UnboundedPreceding { meta } => {
touch(meta);
}
WindowFrameBound::UnboundedFollowing { meta } => {
touch(meta);
}
WindowFrameBound::Preceding { offset, meta } => {
render_shape_expr(offset);
touch(meta);
}
WindowFrameBound::Following { offset, meta } => {
render_shape_expr(offset);
touch(meta);
}
}
}
pub(crate) fn render_shape_window_frame_exclusion(node: &WindowFrameExclusion) {
match node {
WindowFrameExclusion::CurrentRow => {}
WindowFrameExclusion::Group => {}
WindowFrameExclusion::Ties => {}
WindowFrameExclusion::NoOthers => {}
}
}
pub(crate) fn render_shape_named_window<X: Extension>(node: &NamedWindow<X>) {
let NamedWindow {
name,
definition,
meta,
} = node;
render_shape_ident(name);
render_shape_window_definition(definition);
touch(meta);
}
fn render_shape_extension<X: Extension>(node: &X) {
touch(node);
}
fn touch<T: ?Sized>(_value: &T) {}