diff --git a/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.cs b/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.cs index 2a1343751..abf35f95a 100644 --- a/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.cs +++ b/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.cs @@ -705,6 +705,7 @@ void LocalAdd(TableInfo table, T data, bool isCheck, ColumnInfo[] _tableReturnCo case DataType.ShenTong: case DataType.DuckDB: case DataType.Firebird: //firebird 只支持单条插入 returning + case DataType.Xugu: if (_tableIdentitys.Length == 1 && _tableReturnColumns.Length == 1) { var idtval = OrmInsert(table).AppendData(data).ExecuteIdentity(); diff --git a/FreeSql.DbContext/DbSet/DbSetAsync.cs b/FreeSql.DbContext/DbSet/DbSetAsync.cs index 4db2fbe4f..6b0c353e0 100644 --- a/FreeSql.DbContext/DbSet/DbSetAsync.cs +++ b/FreeSql.DbContext/DbSet/DbSetAsync.cs @@ -49,6 +49,7 @@ async Task AddPrivAsync(TEntity data, bool isCheck, CancellationToken cancellati case DataType.ShenTong: case DataType.DuckDB: case DataType.Firebird: //firebird 只支持单条插入 returning + case DataType.Xugu: if (_tableIdentitys.Length == 1 && _tableReturnColumns.Length == 1) { await DbContextFlushCommandAsync(cancellationToken); diff --git a/FreeSql.DbContext/DbSet/DbSetSync.cs b/FreeSql.DbContext/DbSet/DbSetSync.cs index 5d639539f..98ba7b49b 100644 --- a/FreeSql.DbContext/DbSet/DbSetSync.cs +++ b/FreeSql.DbContext/DbSet/DbSetSync.cs @@ -48,6 +48,7 @@ void AddPriv(TEntity data, bool isCheck) case DataType.ShenTong: case DataType.DuckDB: case DataType.Firebird: //firebird 只支持单条插入 returning + case DataType.Xugu: if (_tableIdentitys.Length == 1 && _tableReturnColumns.Length == 1) { DbContextFlushCommand(); diff --git a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs index 77421e705..e5656ab17 100644 --- a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs +++ b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs @@ -751,6 +751,7 @@ WHERE @cte_ids IS NOT NULL case DataType.Firebird: case DataType.ClickHouse: case DataType.DuckDB: + case DataType.Xugu: sql1ctePath = select._commonExpression.ExpressionWhereLambda(select._tables, select._tableRule, Expression.Call(typeof(Convert).GetMethod("ToString", new Type[] { typeof(string) }), pathSelector?.Body), select._diymemexpWithTempQuery, null, null); break; @@ -847,6 +848,7 @@ WHERE @cte_ids IS NOT NULL case DataType.CustomMySql: case DataType.Firebird: case DataType.DuckDB: + case DataType.Xugu: nsselsb.Append("RECURSIVE "); break; } @@ -900,6 +902,7 @@ public static TSelect OrderByRandom(this ISelect0 that case DataType.KingbaseES: case DataType.ShenTong: case DataType.DuckDB: + case DataType.Xugu: return that.OrderBy("random()"); case DataType.Oracle: case DataType.OdbcOracle: diff --git a/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs b/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs index 1d65a44ca..e33020c18 100644 --- a/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs +++ b/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs @@ -1291,6 +1291,7 @@ public TSelect ForUpdate(bool noawait = false) case DataType.OdbcPostgreSQL: case DataType.CustomPostgreSQL: case DataType.KingbaseES: + case DataType.Xugu: _tosqlAppendContent = $"{_tosqlAppendContent} for update{(noawait ? " nowait" : "")}"; break; case DataType.Oracle: diff --git a/FreeSql/Internal/CommonProvider/UpdateJoinProvider.cs b/FreeSql/Internal/CommonProvider/UpdateJoinProvider.cs index 8624d566b..30ea469a5 100644 --- a/FreeSql/Internal/CommonProvider/UpdateJoinProvider.cs +++ b/FreeSql/Internal/CommonProvider/UpdateJoinProvider.cs @@ -82,6 +82,7 @@ public void ValidateDataType(Action InterceptSqlServer, Action InterceptMySql, A case DataType.KingbaseES: case DataType.ShenTong: case DataType.DuckDB: + case DataType.Xugu: InterceptPostgreSQL?.Invoke(); break; case DataType.Oracle: case DataType.OdbcOracle: @@ -216,6 +217,7 @@ public IUpdateJoin SetIf(bool condition, Expression> case DataType.CustomPostgreSQL: case DataType.KingbaseES: case DataType.ShenTong: + case DataType.Xugu: break; default: var tbalias = _query2Provider._tables.Where(tb => tb.Table == col.Table).FirstOrDefault()?.Alias ?? _query2Provider._tables[0].Alias; diff --git a/FreeSql/Internal/CommonProvider/UpdateProvider.cs b/FreeSql/Internal/CommonProvider/UpdateProvider.cs index 593a3165e..66d3fe650 100644 --- a/FreeSql/Internal/CommonProvider/UpdateProvider.cs +++ b/FreeSql/Internal/CommonProvider/UpdateProvider.cs @@ -1197,6 +1197,7 @@ public virtual void ToSqlExtension110(StringBuilder sb, bool isAsTableSplited) case DataType.CustomPostgreSQL: case DataType.KingbaseES: case DataType.ShenTong: + case DataType.Xugu: vcvalue = $"{_tableAlias}.{vcname}"; //set name = b.name break; default: diff --git a/FreeSql/Internal/UtilsExpressionTree.cs b/FreeSql/Internal/UtilsExpressionTree.cs index e67833c6a..053c92646 100644 --- a/FreeSql/Internal/UtilsExpressionTree.cs +++ b/FreeSql/Internal/UtilsExpressionTree.cs @@ -397,6 +397,7 @@ public static ColumnInfo ColumnAttributeToInfo(TableInfo trytb, object entityDef case DataType.CustomPostgreSQL: case DataType.KingbaseES: case DataType.ShenTong: + case DataType.Xugu: if (strlen < 0) colattr.DbType = $"TEXT{strNotNull}"; else colattr.DbType = Regex.Replace(colattr.DbType, charPattern, m => replaceCounter++ == 0 ? $"{m.Groups[1].Value}({strlen})" : m.Groups[0].Value); @@ -470,7 +471,8 @@ public static ColumnInfo ColumnAttributeToInfo(TableInfo trytb, object entityDef case DataType.CustomPostgreSQL: case DataType.KingbaseES: case DataType.ShenTong: //驱动引发的异常:“System.Data.OscarClient.OscarException”(位于 System.Data.OscarClient.dll 中) - colattr.DbType = $"BYTEA{strNotNull}"; //变长二进制串 + case DataType.Xugu: + colattr.DbType = $"BYTEA{strNotNull}"; //变长二进制串 break; case DataType.Oracle: case DataType.OdbcOracle: