ColumnMetadata class
Metadata for a single column in a query result.
Pure domain entity — carries only the column name and the
protocol type discriminant (mirror of the Rust OdbcType enum
at native/odbc_engine/src/protocol/types.rs). The numeric value
is the wire protocol discriminant, not the ODBC SQL_* type
code.
The richer typed view (OdbcType enum) lives in the
infrastructure layer and is exposed as an extension on
ColumnMetadata so the domain stays free of FFI / protocol
dependencies. Consumers who need the typed view import the
extension explicitly:
import 'package:odbc_fast/odbc_fast.dart';
for (final col in qr.columnsMetadata ?? const <ColumnMetadata>[]) {
print('${col.name} -> discriminant=${col.odbcType}');
}
Discriminant table (truncated):
| Discriminant | Wire type |
|---|---|
| 1 | varchar (UTF-8) |
| 2 | integer (i32 LE) |
| 3 | bigInt (i64 LE) |
| 4 | decimal (UTF-8) |
| 5 | date (UTF-8) |
| 6 | timestamp (UTF-8) |
| 7 | binary (raw) |
See the OdbcType enum for the full mapping.
- Available extensions
- Annotations
-
- @immutable
Constructors
- ColumnMetadata({required String name, required int odbcType})
-
Creates a new ColumnMetadata instance.
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- name → String
-
Column name.
final
- odbcType → int
-
Protocol type discriminant (matches
OdbcType.discriminant). Unknown discriminants degrade to varchar (1) for forward compatibility — see the typed view extension.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → OdbcType
-
Available on ColumnMetadata, provided by the ColumnMetadataTypedView extension
Typed view ofodbcType. Unknown discriminants degrade to OdbcType.varchar (forward-compatible).no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override