refactor: dbms

This commit is contained in:
meilin.huang
2024-03-21 20:28:24 +08:00
parent b2cfd1517c
commit 4b3ed1310d
11 changed files with 34 additions and 33 deletions

View File

@@ -111,7 +111,7 @@ func (md *MssqlMetaData) GetColumns(tableNames ...string) ([]dbi.Column, error)
DataType: dbi.ColumnDataType(anyx.ToString(re["DATA_TYPE"])),
CharMaxLength: cast.ToInt(re["CHAR_MAX_LENGTH"]),
ColumnComment: anyx.ToString(re["COLUMN_COMMENT"]),
Nullable: anyx.ToString(re["NULLABLE"]),
Nullable: anyx.ToString(re["NULLABLE"]) == "YES",
IsPrimaryKey: cast.ToInt(re["IS_PRIMARY_KEY"]) == 1,
IsIdentity: cast.ToInt(re["IS_IDENTITY"]) == 1,
ColumnDefault: cast.ToString(re["COLUMN_DEFAULT"]),
@@ -287,7 +287,7 @@ func (md *MssqlMetaData) genColumnBasicSql(column dbi.Column) string {
}
nullAble := ""
if column.Nullable == "NO" {
if !column.Nullable {
nullAble = " NOT NULL"
}