- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDataRow.cs
More file actions
Latest commit
101 lines (86 loc) · 3.83 KB
/
Copy pathDataRow.cs
File metadata and controls
101 lines (86 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Text;
usingSystem.IO;
usingSystem.Linq;
usingSystem.Threading;
usingUtilPack;
usingSystem.Threading.Tasks;
usingCBAM.SQL.Implementation;
usingCBAM.Abstractions.Implementation;
usingUtilPack.TabularData;
usingCBAM.Abstractions.Implementation.Tabular;
namespaceCBAM.SQL.PostgreSQL.Implementation
{
internalsealedclassPgSQLDataRowColumn:DataColumnSUKSWithConnectionFunctionality<PostgreSQLProtocol>
{
privatereadonlyDataFormat_dataFormat;
privateDataRowObject_backendMessage;
publicPgSQLDataRowColumn(
PgSQLDataColumnMetaDataImplmetadata,
Int32thisStreamIndex,
PgSQLDataRowColumnpreviousColumn,
PostgreSQLProtocolprotocol,
ReservedForStatementreservedForStatement,
RowDescription.FieldDatafieldData
):base(metadata,thisStreamIndex,previousColumn,protocol,reservedForStatement)
{
this._dataFormat=ArgumentValidator.ValidateNotNull(nameof(fieldData),fieldData).DataFormat;
}
protectedoverrideValueTask<Object>ReadValueWhileReservedAsync(Int32byteCount)
{
returnthis.ConnectionFunctionality.ConvertFromBytes(((PgSQLDataColumnMetaDataImpl)this.MetaData).SQLTypeID,this._dataFormat,this.ReservedForStatement,byteCount);
}
protectedoverrideasyncValueTask<Int32>ReadByteCountAsync()
{
returnawaitthis._backendMessage.ReadColumnByteCount(this.ConnectionFunctionality.MessageIOArgs,this.ConnectionFunctionality.Stream,this.ConnectionFunctionality.CurrentCancellationToken,this.ColumnIndex,this.ConnectionFunctionality.Buffer);
}
protectedoverrideasyncValueTask<Int32>ReadFromStreamWhileReservedAsync(Byte[]array,Int32offset,Int32count)
{
returnawaitthis.ConnectionFunctionality.Stream.ReadAsync(array,offset,count,this.ConnectionFunctionality.CurrentCancellationToken);
}
publicvoidReset(DataRowObjectnextRow)
{
this.Reset();
Interlocked.Exchange(refthis._backendMessage,nextRow);
}
}
internalsealedclassPgSQLDataRowMetaDataImpl:DataRowMetaDataImpl<AsyncDataColumnMetaData>//, PgSQLDataRowMetaData
{
publicPgSQLDataRowMetaDataImpl(
PgSQLDataColumnMetaDataImpl[]columnMetaDatas
)
:base(columnMetaDatas)
{
}
}
internalsealedclassPgSQLDataColumnMetaDataImpl:AbstractAsyncDataColumnMetaData,PgSQLDataColumnMetaData
{
privatereadonlyPostgreSQLProtocol_connectionFunctionality;
privatereadonlyDataFormat_dataFormat;
publicPgSQLDataColumnMetaDataImpl(
PostgreSQLProtocolconnectionFunctionality,
DataFormatdataFormat,
Int32typeID,
TypeFunctionalityInformationtypeInfo,
Stringlabel
):base(typeInfo?.CLRType??typeof(String),label)
{
this._connectionFunctionality=ArgumentValidator.ValidateNotNull(nameof(connectionFunctionality),connectionFunctionality);
this._dataFormat=dataFormat;
this.SQLTypeID=typeID;
this.TypeInfo=typeInfo;
}
publicoverrideObjectChangeType(Objectvalue,TypetargetType)
{
vartypeInfo=this.TypeInfo;
returntypeInfo.Functionality.ChangeTypePgSQLToFramework(typeInfo.DatabaseData,value,targetType);
}
publicoverrideValueTask<Object>ConvertFromBytesAsync(Streamstream,Int32byteCount)
{
returnthis._connectionFunctionality.ConvertFromBytes(this.SQLTypeID,this._dataFormat,stream,byteCount);
}
publicInt32SQLTypeID{get;}
privateTypeFunctionalityInformationTypeInfo{get;}
}
}