Returns the final, proper name component of an identifier. In an identifier
which names a column, this is the column name. In an identifier which names
a table, this is the table name. All identifiers
have this component, so it is a String and not a Maybe.

Returns the parent name component of an identifier, if it exists. In an
identifier which names a column, this is the table name. In an identifier
which names a table or other database-level object, this is the database name.

Abstract syntax tree nodes

There are a great many types of nodes in the
abstract syntax tree. They are loosely divided
into
statements (commands to possibly be executed),
expressions (algebraic expressions to possibly
be evaluated),
clauses (major portions of a statement or
expression which have very complicated
grammatical structure),
subclauses (portions of clauses which still have
some grammatical structure),
qualifiers (things which have minimal grammatical
structure of their own, but can be present and
cause some change in semantics if they are),
keywords (things which have minimal grammatical
structure of their own, and no semantic meaning
either, but can be present),
heads (within a statement, groups of multiple
clauses which include the verb of the
statement),
and
bodies (within a statement, groups of multiple
clauses which do not include the verb of the
statement).

The guiding principle behind the selection of
which things to give their own node-types to is
that it should be possible to parse SQL and
print it back out identically except for
whitespace. This means for example that !=
and are distinct in the AST, as are
NOT NULL and NOTNULL, and is the rationale
behind the inclusion of the keywords category
which has no semantic meaning. A likely use of
this library is to implement a system which allows
the same queries to be edited both as plaintext
SQL and as some graphical form, and if a user
edits as SQL, he expects these things to be
preserved, as they can be important to
readability.

When a qualifier is omitted, it's prefixed with
No as in NoIfNotExists. When a keyword is
omitted, it's prefixed with Elided as in
ElidedTransaction. This is to remind you that
an omitted qualifier has some sensible default
semantic, whereas an omitted keyword has the
same semantics as if it were present.

There is a great deal of sharing of structure,
so I have made no attempt in this documentation to
organize the exports by category, except to give
expressions and statements their own sections;
instead, please enjoy this alphabetical index!

The AST node corresponding to a source from which to join columns in a SELECT
statement, which may be the head of the statement's FROM clause, or, in the
case of a subjoin, only part of it. Used by FromClause and SingleSource.

The AST node which corresponds to a statement. Not directly useful at
top level because it is a generalized algebraic datatype the type parameters
to which are not exported; instead, see the existentially qualified
types AnyStatement, ExplainableStatement, and TriggerStatement, and the
type synonyms such as Select which correspond to individual statement types.

I apologize for the lack of documentation on these individual entries, but
Haddock won't let me do it! At any rate, each of them is an AST node corresponding
to an individual statement type.

Note the distinctions between
Delete and DeleteLimited and Update and UpdateLimited: The Limited ones
have LIMIT clauses and the others do not. Because SQL imposes stricter
restrictions on where the ones with LIMIT clauses can occur, these are are
separate types.