SqlEngine class

Available Extensions

Constructors

SqlEngine([EngineOptions? engineOptions])

Properties

hashCode int
The hash code for this object.
no setterinherited
knownResultSets List<NamedResultSet>
All tables registered with registerTable.
final
options EngineOptions
Internal options for this sql engine.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaReader SchemaFromCreateTable
Obtain a SchemaFromCreateTable instance compatible with the configuration of this engine.
no setter

Methods

analyze(String sql, {AnalyzeStatementOptions? stmtOptions}) AnalysisContext
Parses and analyzes the sql statement. The AnalysisContext returned contains all information about type hints, errors, and the parsed AST.
analyzeNode(AstNode node, String file, {AnalyzeStatementOptions? stmtOptions}) AnalysisContext
Analyzes the given node, which should be a CrudStatement. The AnalysisContext enhances the AST by reporting type hints and errors. The file should contain the full SQL source code that was used to parse the node.
analyzeParsed(ParseResult result, {AnalyzeStatementOptions? stmtOptions}) AnalysisContext
Analyzes a parsed result statement. The AnalysisContext returned contains all information about type hints, errors, and the parsed AST.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String sql) ParseResult
Parses a single sql statement into an AST-representation.
parseColumnConstraints(String sql) ParseResult
Parses sql as a list of column constraints.
parseDriftFile(String content) ParseResult
Parses a .drift file, which can consist of multiple statements and additional components like import statements.
parseMultiple(String sql) ParseResult
Parses multiple sql statements, separated by a semicolon.
parseTableConstraint(String sql) ParseResult
Parses sql as a single table constraint.
registerFunctionHandler(FunctionHandler handler) → void
Registers the handler, which can provide implementations for additional sql functions that can then be used in statements analyzed through this engine.
registerModule(Module module) → void
Registers the module, which means that it can be used as a function in CREATE VIRTUAL TABLE statements.
registerResultSet(NamedResultSet namedResultSet) → void
Registers an arbitrary namedResultSet, which means that it can later be used in sql statements.
registerTable(Table table) → void
Registers the table, which means that it can later be used in sql statements.
registerTableValuedFunctionHandler(TableValuedFunctionHandler handler) → void
Registers the handler, which can infer result sets for a table-valued function.
registerView(View view) → void
Registers the view, which means that it can later be used in sql statements.
tokenize(String source) List<Token>
Tokenizes the source into a list list Tokens. Each Token contains information about where it appears in the source and a TokenType.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited