File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 <Authors >vkuttyp</Authors >
88 <PackageLicenseExpression >MIT</PackageLicenseExpression >
99 <RepositoryUrl >https://github.com/vkuttyp/CosmoSQLClient-Dotnet</RepositoryUrl >
10- <Version >1.5.4 </Version >
10+ <Version >1.5.5 </Version >
1111 </PropertyGroup >
1212</Project >
Original file line number Diff line number Diff line change @@ -101,6 +101,33 @@ public override Type GetFieldType(int ordinal)
101101 } ;
102102 }
103103
104+ public override DataTable GetSchemaTable ( )
105+ {
106+ var dt = new DataTable ( "SchemaTable" ) ;
107+ dt . Columns . Add ( "ColumnName" , typeof ( string ) ) ;
108+ dt . Columns . Add ( "ColumnOrdinal" , typeof ( int ) ) ;
109+ dt . Columns . Add ( "ColumnSize" , typeof ( int ) ) ;
110+ dt . Columns . Add ( "NumericPrecision" , typeof ( short ) ) ;
111+ dt . Columns . Add ( "NumericScale" , typeof ( short ) ) ;
112+ dt . Columns . Add ( "DataType" , typeof ( Type ) ) ;
113+ dt . Columns . Add ( "AllowDBNull" , typeof ( bool ) ) ;
114+
115+ var cols = CurrentSetColumns ;
116+ if ( cols != null )
117+ {
118+ for ( int i = 0 ; i < cols . Count ; i ++ )
119+ {
120+ var row = dt . NewRow ( ) ;
121+ row [ "ColumnName" ] = cols [ i ] . Name ;
122+ row [ "ColumnOrdinal" ] = i ;
123+ row [ "DataType" ] = GetFieldType ( i ) ;
124+ row [ "AllowDBNull" ] = cols [ i ] . IsNullable ;
125+ dt . Rows . Add ( row ) ;
126+ }
127+ }
128+ return dt ;
129+ }
130+
104131 // ── Value accessors ───────────────────────────────────────────────────────
105132
106133 public override bool IsDBNull ( int ordinal ) => Get ( ordinal ) is SqlValue . Null ;
You can’t perform that action at this time.
0 commit comments