mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add test
This commit is contained in:
parent
7c79749b9e
commit
8d9b509cb9
46
Src/Asp.NetCore2/ClickHouseTest/Test/Unitsdfsasss.cs
Normal file
46
Src/Asp.NetCore2/ClickHouseTest/Test/Unitsdfsasss.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using OrmTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ClickHouseTest
|
||||
{
|
||||
public class Unitsdfsasss
|
||||
{
|
||||
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<UnitUintxx1111>();
|
||||
db.Insertable(new List<UnitUintxx1111>(){new UnitUintxx1111() { Wash_RGJson = new { id = 1 } } }).ExecuteCommand();
|
||||
var list= db.Queryable<UnitUintxx1111>().ToList();
|
||||
}
|
||||
public class UnitUintxx1111
|
||||
{
|
||||
//public JObject _Wash_RGJson;
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// 具体清洗规则
|
||||
|
||||
/// </summary>
|
||||
|
||||
[SugarColumn(ColumnDescription = "具体清洗规则", IsJson =true )]
|
||||
|
||||
public object Wash_RGJson { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user