Beispiel #1
0
 private void AddFieldFromLiteral(SqlLiteralExpression literalExpression, string name, MemoryDbDataReader.ResultBatch batch, RawData rawData)
 {
     if (_InsertColumns != null)
     {
         var column      = _InsertColumns[batch.Fields.Count];
         var value       = Helper.GetValueFromString(column.NetDataType, literalExpression);
         var readerField = new MemoryDbDataReader.ReaderFieldData
         {
             Name       = column.Name,
             DbType     = column.DbDataType.ToString(),
             NetType    = column.NetDataType,
             FieldIndex = batch.Fields.Count
         };
         readerField.SelectFieldData = new SelectDataFromObject(value, readerField.DbType);
         batch.Fields.Add(readerField);
     }
     else
     {
         if (literalExpression.Type == LiteralValueType.Null)
         {
             var nullField = Helper.BuildFieldFromNullValue(name, batch.Fields.Count);
             batch.Fields.Add(nullField);
             return;
         }
         var readerField = Helper.BuildFieldFromLiteral(literalExpression.Type, name, batch.Fields.Count);
         var value       = Helper.GetValueFromString(readerField.NetType, literalExpression);
         readerField.SelectFieldData = new SelectDataFromObject(value, readerField.DbType);
         batch.Fields.Add(readerField);
     }
 }
Beispiel #2
0
        private static void AddFieldFromSelectData(string name, MemoryDbDataReader.ResultBatch batch, ISelectData select)
        {
            var readerField = new MemoryDbDataReader.ReaderFieldData
            {
                Name            = name,
                DbType          = select.DbType.ToString(),
                NetType         = select.ReturnType,
                FieldIndex      = batch.Fields.Count,
                SelectFieldData = select
            };

            batch.Fields.Add(readerField);
        }
Beispiel #3
0
        private void AddFieldFromColumn(SqlObjectIdentifier objectIdentifier, string name, MemoryDbDataReader.ResultBatch batch, RawData rawData)
        {
            var tableColumn = Helper.GetTableColumn(objectIdentifier, rawData);
            var readerField = new MemoryDbDataReader.ReaderFieldData
            {
                Name            = name,
                DbType          = tableColumn.Column.DbDataType.ToString(),
                NetType         = tableColumn.Column.NetDataType,
                FieldIndex      = batch.Fields.Count,
                SelectFieldData = new SelectDataFromColumn(tableColumn, rawData)
            };

            batch.Fields.Add(readerField);
        }
Beispiel #4
0
        private void AddFieldFromColumn(Column column, string tableName, MemoryDbDataReader.ResultBatch batch, RawData rawData)
        {
            var readerField = new MemoryDbDataReader.ReaderFieldData
            {
                Name            = column.Name,
                DbType          = column.DbDataType.ToString(),
                NetType         = column.NetDataType,
                FieldIndex      = batch.Fields.Count,
                SelectFieldData = new SelectDataFromColumn(new TableColumn {
                    Column = column, TableName = tableName
                }, rawData)
            };

            batch.Fields.Add(readerField);
        }