mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 DbFirst 获取字段的默认值信息;
This commit is contained in:
@ -208,7 +208,8 @@ ifnull(a.character_maximum_length, 0) 'len',
|
||||
a.column_type,
|
||||
case when a.is_nullable = 'YES' then 1 else 0 end 'is_nullable',
|
||||
case when locate('auto_increment', a.extra) > 0 then 1 else 0 end 'is_identity',
|
||||
a.column_comment 'comment'
|
||||
a.column_comment 'comment',
|
||||
a.column_default 'default_value'
|
||||
from information_schema.columns a
|
||||
where a.table_schema in ({1}) and {0}
|
||||
", loc8, databaseIn);
|
||||
@ -227,6 +228,7 @@ where a.table_schema in ({1}) and {0}
|
||||
bool is_nullable = string.Concat(row[5]) == "1";
|
||||
bool is_identity = string.Concat(row[6]) == "1";
|
||||
string comment = string.Concat(row[7]);
|
||||
string defaultValue = string.Concat(row[8]);
|
||||
if (max_length == 0) max_length = -1;
|
||||
if (database.Length == 1)
|
||||
{
|
||||
@ -242,7 +244,8 @@ where a.table_schema in ({1}) and {0}
|
||||
DbTypeText = type,
|
||||
DbTypeTextFull = sqlType,
|
||||
Table = loc2[table_id],
|
||||
Coment = comment
|
||||
Coment = comment,
|
||||
DefaultValue = defaultValue
|
||||
});
|
||||
loc3[table_id][column].DbType = this.GetDbType(loc3[table_id][column]);
|
||||
loc3[table_id][column].CsType = this.GetCsTypeInfo(loc3[table_id][column]);
|
||||
|
Reference in New Issue
Block a user