Package org.h2.command
Class Parser
java.lang.Object
org.h2.command.ParserBase
org.h2.command.Parser
The parser is used to convert a SQL statement string to an command object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AlterTableAddConstraintnewPrimaryKeyConstraintCommand(SessionLocal session, Schema schema, String tableName, Column column) Create a new alter table command.Parse a SQL code snippet that represents an expression for a domain constraint.parseExpression(String sql) Parse a SQL code snippet that represents an expression.parseTableName(String sql) Parse a SQL code snippet that represents a table name.Parse the statement and prepare it for execution.prepareCommand(String sql) Parse a statement or a list of statements, and prepare it for execution.Parse a query and prepare its expressions.voidsetQueryScope(QueryScope queryScope) Sets the query scope.voidsetRightsChecked(boolean rightsChecked) Methods inherited from class org.h2.command.ParserBase
formatNonKeywords, getLastParseIndex, parseColumnList, parseNonKeywords, quoteIdentifier, setLiteralsChecked, setSuppliedParameters, toString
-
Constructor Details
-
Parser
Creates a new instance of parser.- Parameters:
session- the session
-
-
Method Details
-
prepare
Parse the statement and prepare it for execution.- Parameters:
sql- the SQL statement to parse- Returns:
- the prepared object
-
prepareQueryExpression
Parse a query and prepare its expressions. Rights and literals must be already checked.- Parameters:
sql- the SQL statement to parse- Returns:
- the prepared object
-
prepareCommand
Parse a statement or a list of statements, and prepare it for execution.- Parameters:
sql- the SQL statement to parse- Returns:
- the command object
-
newPrimaryKeyConstraintCommand
public static AlterTableAddConstraint newPrimaryKeyConstraintCommand(SessionLocal session, Schema schema, String tableName, Column column) Create a new alter table command.- Parameters:
session- the sessionschema- the schematableName- the tablecolumn- the column- Returns:
- the command
-
setRightsChecked
public void setRightsChecked(boolean rightsChecked) -
setQueryScope
Sets the query scope.- Parameters:
queryScope- the query scope
-
parseExpression
Parse a SQL code snippet that represents an expression.- Parameters:
sql- the code snippet- Returns:
- the expression object
-
parseDomainConstraintExpression
Parse a SQL code snippet that represents an expression for a domain constraint.- Parameters:
sql- the code snippet- Returns:
- the expression object
-
parseTableName
Parse a SQL code snippet that represents a table name.- Parameters:
sql- the code snippet- Returns:
- the table object
-