protected abstract Task <byte[]> GetSqlInfo(byte[] items, int bufferLength, AsyncWrappingCommonArgs async);
 public abstract Task Attach(ServiceParameterBuffer spb, string dataSource, int port, string service, byte[] cryptKey, AsyncWrappingCommonArgs async);
 public abstract Task Start(ServiceParameterBuffer spb, AsyncWrappingCommonArgs async);
 protected abstract Task Cancel(AsyncWrappingCommonArgs async);
 public Task Write(string data, AsyncWrappingCommonArgs async)
 {
     return(Write(_charset.GetBytes(data), async));
 }
 protected abstract Task GetSegment(Stream stream, AsyncWrappingCommonArgs async);
 protected abstract Task Seek(int position, AsyncWrappingCommonArgs async);
예제 #8
0
 public Task Initialize(AsyncWrappingCommonArgs async)
 {
     return(LookupBounds(async));
 }
예제 #9
0
        public async Task <Array> Read(AsyncWrappingCommonArgs async)
        {
            var slice = await GetSlice(GetSliceLength(true), async).ConfigureAwait(false);

            return(await DecodeSlice(slice, async).ConfigureAwait(false));
        }
        protected async Task <DbStatementType> GetStatementType(AsyncWrappingCommonArgs async)
        {
            var buffer = await GetSqlInfo(StatementTypeInfoItems, IscCodes.STATEMENT_TYPE_BUFFER_SIZE, async).ConfigureAwait(false);

            return(ProcessStatementTypeInfoBuffer(buffer));
        }
        public async Task FixNull(AsyncWrappingCommonArgs async)
        {
            if (NullFlag == -1 && await _dbValue.IsDBNull(async).ConfigureAwait(false))
            {
                switch (DbDataType)
                {
                case DbDataType.Char:
                case DbDataType.VarChar:
                    DbValue.SetValue(string.Empty);
                    break;

                case DbDataType.Guid:
                    DbValue.SetValue(Guid.Empty);
                    break;

                case DbDataType.SmallInt:
                    DbValue.SetValue((short)0);
                    break;

                case DbDataType.Integer:
                    DbValue.SetValue((int)0);
                    break;

                case DbDataType.BigInt:
                case DbDataType.Binary:
                case DbDataType.Array:
                case DbDataType.Text:
                    DbValue.SetValue((long)0);
                    break;

                case DbDataType.Numeric:
                case DbDataType.Decimal:
                    DbValue.SetValue((decimal)0);
                    break;

                case DbDataType.Float:
                    DbValue.SetValue((float)0);
                    break;

                case DbDataType.Double:
                    DbValue.SetValue((double)0);
                    break;

                case DbDataType.Date:
                case DbDataType.TimeStamp:
                    DbValue.SetValue(new DateTime(0 * 10000L + 621355968000000000));
                    break;

                case DbDataType.Time:
                    DbValue.SetValue(TimeSpan.Zero);
                    break;

                case DbDataType.Boolean:
                    DbValue.SetValue(false);
                    break;

                case DbDataType.TimeStampTZ:
                case DbDataType.TimeStampTZEx:
                    DbValue.SetValue(new FbZonedDateTime(new DateTime(0 * 10000L + 621355968000000000), TimeZoneMapping.DefaultTimeZoneName));
                    break;

                case DbDataType.TimeTZ:
                case DbDataType.TimeTZEx:
                    DbValue.SetValue(new FbZonedTime(TimeSpan.Zero, TimeZoneMapping.DefaultTimeZoneName));
                    break;

                case DbDataType.Dec16:
                case DbDataType.Dec34:
                    DbValue.SetValue(new FbDecFloat(0, 0));
                    break;

                case DbDataType.Int128:
                    DbValue.SetValue((BigInteger)0);
                    break;

                default:
                    throw IscException.ForStrParam($"Unknown sql data type: {DataType}.");
                }
            }
        }
        protected async Task <int> GetRecordsAffected(AsyncWrappingCommonArgs async)
        {
            var buffer = await GetSqlInfo(RowsAffectedInfoItems, IscCodes.ROWS_AFFECTED_BUFFER_SIZE, async).ConfigureAwait(false);

            return(ProcessRecordsAffectedBuffer(buffer));
        }
 protected Task <byte[]> GetSqlInfo(byte[] items, AsyncWrappingCommonArgs async)
 {
     return(GetSqlInfo(items, IscCodes.DEFAULT_MAX_BUFFER_SIZE, async));
 }
 protected abstract Task Free(int option, AsyncWrappingCommonArgs async);
예제 #15
0
 public ValueTask <bool> IsDBNull(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(TypeHelper.IsDBNull(_value)));
 }
예제 #16
0
 public async Task Write(Array sourceArray, AsyncWrappingCommonArgs async)
 {
     SetDesc(sourceArray);
     await PutSlice(sourceArray, GetSliceLength(false), async).ConfigureAwait(false);
 }
 protected abstract Task Open(AsyncWrappingCommonArgs async);
 public ExitHolder(AsyncWrappingCommonArgs async, CancellationTokenRegistration cancellationTokenRegistration)
 {
     _async = async;
     _cancellationTokenRegistration = cancellationTokenRegistration;
 }
 protected abstract Task PutSegment(byte[] buffer, AsyncWrappingCommonArgs async);
예제 #20
0
 public ValueTask <char> GetChar(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToChar(_value, CultureInfo.CurrentCulture)));
 }
 protected abstract Task Close(AsyncWrappingCommonArgs async);
예제 #22
0
 public ValueTask <byte> GetByte(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToByte(_value, CultureInfo.InvariantCulture)));
 }
        public async Task <string> ReadString(AsyncWrappingCommonArgs async)
        {
            var buffer = await Read(async).ConfigureAwait(false);

            return(_charset.GetString(buffer, 0, buffer.Length));
        }
예제 #24
0
 public ValueTask <long> GetInt64(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToInt64(_value, CultureInfo.InvariantCulture)));
 }
 public Task Write(byte[] buffer, AsyncWrappingCommonArgs async)
 {
     return(Write(buffer, 0, buffer.Length, async));
 }
예제 #26
0
 public ValueTask <decimal> GetDecimal(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToDecimal(_value, CultureInfo.InvariantCulture)));
 }
 public abstract Task Detach(AsyncWrappingCommonArgs async);
예제 #28
0
 public ValueTask <float> GetFloat(AsyncWrappingCommonArgs async)
 {
     return(ValueTask2.FromResult(Convert.ToSingle(_value, CultureInfo.InvariantCulture)));
 }
 public abstract Task Query(ServiceParameterBuffer spb, int requestLength, byte[] requestBuffer, int bufferLength, byte[] buffer, AsyncWrappingCommonArgs async);
 public abstract Task <ArrayBase> CreateArray(long handle, string tableName, string fieldName, AsyncWrappingCommonArgs async);