Skip to content

Commit

Permalink
- 修复 ClickHouse UpdateDict 报错问题;#1712
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Jan 15, 2024
1 parent b4fe1e8 commit 7093ca7
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 100 deletions.
210 changes: 112 additions & 98 deletions FreeSql/FreeSql.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Providers/FreeSql.Provider.ClickHouse/ClickHouseUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public override DbParameter[] GetDbParamtersByObject(string sql, object obj) =>

public override string RewriteColumn(ColumnInfo col, string sql)
{
if (string.IsNullOrWhiteSpace(col?.Attribute?.DbType)) return sql;
col.Attribute.DbType = col.Attribute.DbType.Replace(" NOT NULL", "");
if (string.IsNullOrWhiteSpace(col?.Attribute.RewriteSql) == false)
return string.Format(col.Attribute.RewriteSql, sql);
if (Regex.IsMatch(sql, @"\{\{[\w\d]+_+\d:\{\d\}\}\}"))
return string.Format(sql, col.Attribute.DbType);
else
return sql;
return sql;
}

public override string FormatSql(string sql, params object[] args) => sql?.FormatClickHouse(args);
Expand Down

0 comments on commit 7093ca7

Please sign in to comment.