From b1f37b672ca8a286cd508875d87cb244725c8365 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Wed, 5 Jul 2023 21:34:39 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=20QuestDB=20Guid=20?= =?UTF-8?q?=E6=98=A0=E5=B0=84=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Internal/UtilsExpressionTree.cs | 8 +++++++- Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/FreeSql/Internal/UtilsExpressionTree.cs b/FreeSql/Internal/UtilsExpressionTree.cs index b23ef858..fa4fa306 100644 --- a/FreeSql/Internal/UtilsExpressionTree.cs +++ b/FreeSql/Internal/UtilsExpressionTree.cs @@ -1150,7 +1150,13 @@ namespace FreeSql.Internal foreach (var col in tbmid.Primarys) { 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; + } } } } diff --git a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs index 6c345280..ea4d09ae 100644 --- a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs +++ b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs @@ -56,7 +56,7 @@ namespace FreeSql.QuestDb { typeof(string).FullName, CsToDb.New(NpgsqlDbType.Varchar, "string", "string", false, null, "") }, { 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(DateTime).FullName, CsToDb.New(NpgsqlDbType.Timestamp, "timestamp", "timestamp NOT NULL", false, false, new DateTime(1970, 1, 1)) },