Skip to main content

Module classify

Module classify 

Source
Expand description

Classification of a statement by its syntax tree.

The reference implementations decide what a statement does by looking at its first word. That is wrong in both directions: a leading comment moves the first word, and a reserved word inside a literal is not the first word of anything. This module parses the statement and decides from the tree.

§Refusal is the default

A statement whose shape this module does not recognise is refused. It is never treated as a read, because a wrong guess in that direction is the one that changes data.

Reading the text into a tree, and the bounds that make that safe, belong to crate::sql::parse. This module only decides what the tree means.

Structs§

Analysis
The outcome of reading one statement.

Enums§

Classification
What a statement does, as read from its syntax tree.

Functions§

analyze
Reads a statement and says what it does.
classify
Reads a statement and says what it does, discarding the tree.