Update ClickHouse

This commit is contained in:
sunkaixuan
2022-08-13 19:02:01 +08:00
parent 40f10ef701
commit aac02169b6
2 changed files with 7 additions and 7 deletions

View File

@@ -37,18 +37,18 @@ namespace OrmTest
};
//Ignore CreateTime
db.Insertable(insertObj).IgnoreColumns(it => new { it.CreateTime }).ExecuteReturnIdentity();//get identity
db.Insertable(insertObj).IgnoreColumns("CreateTime").ExecuteReturnIdentity();
db.Insertable(insertObj).IgnoreColumns(it => new { it.CreateTime }).ExecuteReturnSnowflakeId();//get identity
db.Insertable(insertObj).IgnoreColumns("CreateTime").ExecuteReturnSnowflakeId();
//Only insert Name and Price
db.Insertable(insertObj).InsertColumns(it => new { it.Name, it.Price }).ExecuteReturnIdentity();
db.Insertable(insertObj).InsertColumns("Name", "Price").ExecuteReturnIdentity();
db.Insertable(insertObj).InsertColumns(it => new { it.Name, it.Price }).ExecuteReturnSnowflakeId();
db.Insertable(insertObj).InsertColumns("Name", "Price").ExecuteReturnSnowflakeId();
//ignore null columns
db.Insertable(updateObjs).ExecuteCommand();//get change row count
db.Insertable(updateObjs).ExecuteReturnSnowflakeId();//get change row count
//Use Lock
db.Insertable(insertObj).With(SqlWith.UpdLock).ExecuteCommand();
db.Insertable(insertObj).With(SqlWith.UpdLock).ExecuteReturnSnowflakeId();
Console.WriteLine("#### Insertable End ####");
}