tiberius icon indicating copy to clipboard operation
tiberius copied to clipboard

BaseMetaDataColumn does not retrieve Identity flag

Open etylermoss opened this issue 3 months ago • 0 comments

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.

etylermoss avatar Jan 06 '26 21:01 etylermoss