From ae272047d21ae7d712c90fb2ecdba58a415b849e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 3 Mar 2025 14:46:08 +0800 Subject: [PATCH] Add demo --- .../ClickHouseTest/Test/Unitasdfayasdfa.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs diff --git a/Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs b/Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs new file mode 100644 index 000000000..a6c81c930 --- /dev/null +++ b/Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs @@ -0,0 +1,36 @@ +using OrmTest; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ClickHouseTest +{ + public class Unitasdfayasdfa + { + public static void Init() + { + var db = new SqlSugarClient(new SqlSugar.ConnectionConfig() + { + ConnectionString = Config.ConnectionString, + DbType = SqlSugar.DbType.ClickHouse, + IsAutoCloseConnection = true + }); + db.Aop.OnLogExecuting = (sql, pars) => { + var log = $"【{DateTime.Now}——执行SQL】\r\n{UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars)}\r\n"; + Console.WriteLine(log); + }; + + db.CodeFirst.InitTables(); + db.Insertable(new UnitUint() { id = 11 }).ExecuteCommand(); + var lit=db.Queryable().ToList(); + } + public class UnitUint + { + [SqlSugar.SugarColumn(ColumnDataType = "uint32")] + public uint id { get; set; } + } + } +}