mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 优化 QuestDB Guid 映射;
This commit is contained in:
parent
4da56f4435
commit
b1f37b672c
@ -1150,7 +1150,13 @@ namespace FreeSql.Internal
|
|||||||
foreach (var col in tbmid.Primarys)
|
foreach (var col in tbmid.Primarys)
|
||||||
{
|
{
|
||||||
col.Attribute.IsNullable = false;
|
col.Attribute.IsNullable = false;
|
||||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim() + " NOT NULL"; //sqlite 主键也可以插入 null
|
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
|
||||||
|
switch (common._orm.Ado.DataType)
|
||||||
|
{
|
||||||
|
case DataType.Sqlite:
|
||||||
|
col.Attribute.DbType += " NOT NULL"; //sqlite 主键也可以插入 null
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace FreeSql.QuestDb
|
|||||||
|
|
||||||
{ typeof(string).FullName, CsToDb.New(NpgsqlDbType.Varchar, "string", "string", false, null, "") },
|
{ typeof(string).FullName, CsToDb.New(NpgsqlDbType.Varchar, "string", "string", false, null, "") },
|
||||||
{ typeof(char).FullName, CsToDb.New(NpgsqlDbType.Char, "char", "char", false, null, '\0') },
|
{ typeof(char).FullName, CsToDb.New(NpgsqlDbType.Char, "char", "char", false, null, '\0') },
|
||||||
{ typeof(Guid).FullName, CsToDb.New(NpgsqlDbType.Char, "symbol", "symbol NOT NULL", false, null, Guid.Empty) },
|
{ typeof(Guid).FullName, CsToDb.New(NpgsqlDbType.Char, "symbol", "symbol", false, null, Guid.Empty) },
|
||||||
{ typeof(Guid?).FullName, CsToDb.New(NpgsqlDbType.Char, "symbol", "symbol", false, true, null) },
|
{ typeof(Guid?).FullName, CsToDb.New(NpgsqlDbType.Char, "symbol", "symbol", false, true, null) },
|
||||||
|
|
||||||
{ typeof(DateTime).FullName, CsToDb.New(NpgsqlDbType.Timestamp, "timestamp", "timestamp NOT NULL", false, false, new DateTime(1970, 1, 1)) },
|
{ typeof(DateTime).FullName, CsToDb.New(NpgsqlDbType.Timestamp, "timestamp", "timestamp NOT NULL", false, false, new DateTime(1970, 1, 1)) },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user