大数据库 BI分析 和时序库 应用场景比较接近
host=localhost;port=8123;user=default;password=;database=default
SqlSugar.ClickHouseCore SqlSugarCore
//程序启动时加入
InstanceFactory.CustomAssemblies =
new System.Reflection.Assembly[] { typeof(ClickHouseProvider).Assembly };
//业务中使用
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.ClickHouse,
ConnectionString = "host=localhost;port=8123;user=default;password=;database=default",
IsAutoCloseConnection = true
});要用最新版要
docker pull yandex/clickhouse-server
1、大小写要和数据库一样模一样,用的时候需要注意一下
2、不支持事务
3、只支持Linux
DbType = DbType.ClickHouse,
可以去GITHUB下载完整DEMO

请升级到
SqlSugarCore 5.1.3.31-preview11 及以上版本
SqlSugar.ClickHouseCore 5.1.3.31
//同步 db.Fastest<DC_Scene>().BulkCopy(lstData); //高并发异步 await db.CopyNew().Fastest<DC_Scene>().BulkCopyAsync(lstData);
需要升级到:SqlSugar.ClickHouseCore 5.1.4.66
如果不想用Json想用原生数组类型 可以下面方式定义
[SugarColumn(ColumnDataType = "Array(UInt64)",IsArray =true)]//custom
public UInt64[] Text { get; set; }需要升级 SqlSugar.ClickHouseCore
[SqlSugar.ClickHouse.CKTable(@"engine = MergeTree PARTITION BY toYYYYMM(dt)
ORDER BY(toYYYYMM(dt))
SETTINGS index_granularity = 8192;")]
public class CKTest
{
public string Id { get; set; }
public DateTime dt { get; set; }
}升级:5.1.4.114-preview+ 如果没有以上版本勾一下预览
//程序启动时加入
InstanceFactory.CustomAssemblies =
new System.Reflection.Assembly[] { typeof(ClickHouseProvider).Assembly };2016 © donet5.comApache Licence 2.0