tiberius
tiberius copied to clipboard
BaseMetaDataColumn does not retrieve Identity flag
Issue could be with more than just this flag, untested with others. Looks like the column size (nvarchar(x)) is also incorrect?
client.execute("
CREATE TABLE [Example]
(
ID INT PRIMARY KEY IDENTITY(1, 1) NOT NULL
,Name NVARCHAR(255) NOT NULL
,Code NVARCHAR(255)
);
", &[]).await?;
let table_schema = client.column_metadata("[Example]", &["[ID]", "[Name]", "[Code]"]).await?;
for column in table_schema {
println!(
"column: {}, flags: {}, ty: {}",
column.col_name,
column.base.flags,
column.base.ty,
);
}
Output:
column: ID, flags: UpdateableUnknown, ty: int
column: Name, flags: Updateable, ty: nvarchar(510)
column: Code, flags: Nullable | Updateable, ty: nvarchar(510)
Using column_metadata function from PR #398.