Expand description
This module houses the definitions of the structs and enums that are formally part of the AST.
A few notes about the layout of this module:
-
The public interface of the
sql::ast
module exposes all of these types in one big namespace.The submodules here exist only to avoid having one massive file with every type in it. Separation into modules would be annoying for consumers of the AST, who donβt want to remember e.g. whether the
Ident
type is in theexpr
module or thename
module or thevalue
module. -
Only types that are actually part of the AST live in this module. This moduleβs contents are parsed by the build script to e.g. automatically generate an AST visitor, and the build script gets confused if there are helper structs interspersed.
Helper structs should live in a separate submodule of
crate::ast
, likecrate::ast::display
. -
Do not import types from this module directly. I.e., use
crate::ast::Ident
, notcrate::ast::defs::name::Ident
. The former import path makes it possible to reorganize this module without changing everyuse
statement.
Re-exports§
pub use ddl::*;
pub use expr::*;
pub use name::*;
pub use query::*;
pub use statement::*;
pub use value::*;