pub struct BaseMetaDataColumn {
pub flags: BitFlags<ColumnFlag>,
pub ty: TypeInfo,
pub table_name: Option<String>,
}Expand description
Describes the type and flags of a column, exposing metadata such as the column type (including size, precision and scale), whether the column is nullable and whether it is an identity column.
Fields§
§flags: BitFlags<ColumnFlag>The set of ColumnFlags describing the column (nullability, identity,
updateability, and so on).
ty: TypeInfoThe type of the column, including its size, precision and scale where applicable.
table_name: Option<String>Destination table name, used only on the encode (bulk-load) path. Per
MS-TDS §2.2.7.4, text/ntext/image columns carry a TableName
element in COLMETADATA; the bulk-insert code sets this to the target
table so BaseMetaDataColumn::encode can emit it. It is always None
on the decode (server→client) path, which never needs it.
Implementations§
Source§impl BaseMetaDataColumn
impl BaseMetaDataColumn
Sourcepub fn ty(&self) -> &TypeInfo
pub fn ty(&self) -> &TypeInfo
The type of the column, including its size, precision and scale where applicable.
Sourcepub fn flags(&self) -> BitFlags<ColumnFlag>
pub fn flags(&self) -> BitFlags<ColumnFlag>
The set of flags describing the column.
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
true if the column accepts NULL values.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
true if the column is an identity column.
Sourcepub fn is_updateable(&self) -> bool
pub fn is_updateable(&self) -> bool
true if the column is writeable (e.g. usable as a bulk-insert target).
The COLMETADATA usUpdateable sub-field (MS-TDS §2.2.7.4) is one of
read-only (0), read/write (1), or unknown (2). SQL Server reports
unknown for many legitimate bulk-target columns rather than an explicit
read/write, so both read/write and unknown are treated as writeable here;
only an explicit read-only column (neither flag set) is excluded.