18 using System.Collections.Generic;
25 namespace Deveel.Data.Sql.Parser {
31 public IEnumerable<ColumnConstraintNode> Constraints {
get;
private set; }
35 public bool IsIdentity {
get;
private set; }
38 ColumnName = this.FindNode<IdentifierNode>();
39 DataType = this.FindNode<DataTypeNode>();
40 Default = this.FindNode<IExpressionNode>();
41 IsIdentity = this.HasOptionalNode(
"column_identity_opt");
43 Constraints = this.FindNodes<ColumnConstraintNode>();
57 columnInfo.IsIdentity =
true;
60 foreach (var constraint
in Constraints) {
65 var fTable = constraint.ReferencedTable.Name;
66 var fColumn = constraint.ReferencedColumn.Text;
70 if (!
String.IsNullOrEmpty(constraint.OnDeleteAction))
72 if (!
String.IsNullOrEmpty(constraint.OnUpdateAction))
81 columnInfo.IsNotNull =
true;
83 columnInfo.IsNotNull =
false;
This is a simple identifier within a SQL grammar.
override void OnNodeInit()
After the initialization of the node from the parser, this method is invoked to let the specific init...
A long string in the system.
static SqlExpression Build(IExpressionNode node)
static SqlType Build(ITypeResolver resolver, ISqlNode sqlNode)
static SqlTableConstraint PrimaryKey(string constraintName, string[] columns)
static ForeignKeyAction GetForeignKeyAction(string actionName)
No specific form of the parameter was given: this default to the system default parameter style confi...
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
static SqlTableConstraint UniqueKey(string constraintName, string[] columns)
SqlTableColumn BuildColumn(ITypeResolver typeResolver, string tableName, IList< SqlTableConstraint > constraints)
static SqlBinaryExpression Add(SqlExpression left, SqlExpression right)
static SqlTableConstraint Check(string constraintName, SqlExpression expression)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
static SqlFunctionCallExpression FunctionCall(ObjectName functionName)
Describes the information of a data type as found in a SQL string.
This interface acts like a marker that indicates if a ISqlNode represents a SQL expression.
static SqlTableConstraint ForeignKey(string constraintName, string[] columns, string refTable, string[] refcolumns, ForeignKeyAction onDelete, ForeignKeyAction onUpdate)
The default implementation of ISqlNode, that is a node in the text analysis parsing of SQL commands...