mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 IsVersion string 字符串乐观锁;#1178
This commit is contained in:
@ -206,6 +206,14 @@ namespace FreeSql.ClickHouse.Curd
|
||||
_updateVersionValue = Utils.GuidToBytes(Guid.NewGuid());
|
||||
sb.Append(", ").Append(vcname).Append(" = ").Append(_commonUtils.GetNoneParamaterSqlValue(_paramsSource, "uv", _table.VersionColumn, _table.VersionColumn.Attribute.MapType, _updateVersionValue));
|
||||
}
|
||||
else if (_versionColumn.Attribute.MapType == typeof(string))
|
||||
{
|
||||
_updateVersionValue = Guid.NewGuid().ToString();
|
||||
sb.Append(", ").Append(vcname).Append(" = ").Append(_noneParameter ? _commonUtils.GetNoneParamaterSqlValue(_paramsSource, "uv", _versionColumn, _versionColumn.Attribute.MapType, _updateVersionValue) :
|
||||
_commonUtils.QuoteWriteParamterAdapter(_versionColumn.Attribute.MapType, _commonUtils.QuoteParamterName($"p_{_paramsSource.Count}")));
|
||||
if (_noneParameter == false)
|
||||
_commonUtils.AppendParamter(_paramsSource, null, _versionColumn, _versionColumn.Attribute.MapType, _updateVersionValue);
|
||||
}
|
||||
else
|
||||
sb.Append(", ").Append(vcname).Append(" = ").Append(_commonUtils.IsNull(vcname, 0)).Append(" + 1");
|
||||
}
|
||||
|
Reference in New Issue
Block a user