public static ColumnInfo Deserialize(BinaryReader reader, ITypeResolver typeResolver) { var version = reader.ReadInt32(); if (version != 3) { throw new FormatException("Invalid version of the Column-Info"); } var columnName = reader.ReadString(); var columnType = TypeSerializer.Deserialize(reader, typeResolver); var notNull = reader.ReadByte() == 1; var columnInfo = new ColumnInfo(columnName, columnType); columnInfo.IsNotNull = notNull; var hasDefault = reader.ReadByte() == 1; if (hasDefault) { columnInfo.DefaultExpression = SqlExpression.Deserialize(reader); } return(columnInfo); }
public override SimplePatternSelectNode Deserialize(BinaryReader reader) { var child = ReadChildNode(reader); var expression = SqlExpression.Deserialize(reader); return(new SimplePatternSelectNode(child, expression)); }
public override ExhaustiveSelectNode Deserialize(BinaryReader reader) { var child = ReadChildNode(reader); var expression = SqlExpression.Deserialize(reader); return(new ExhaustiveSelectNode(child, expression)); }
public override SimpleSelectNode Deserialize(BinaryReader reader) { var child = ReadChildNode(reader); var columnName = ObjectName.Deserialize(reader); var opType = (SqlExpressionType)reader.ReadByte(); var expression = SqlExpression.Deserialize(reader); return(new SimpleSelectNode(child, columnName, opType, expression)); }
public override JoinNode Deserialize(BinaryReader reader) { var left = ReadChildNode(reader); var right = ReadChildNode(reader); var leftColumnName = ObjectName.Deserialize(reader); var op = (SqlExpressionType)reader.ReadByte(); var rightExpression = SqlExpression.Deserialize(reader); return(new JoinNode(left, right, leftColumnName, op, rightExpression)); }
private static SqlExpression[] ReadExpressions(BinaryReader reader) { return(ReadArray(reader, binaryReader => SqlExpression.Deserialize(reader))); }