mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 NoneParameter Oracle 文本超长的问题;
This commit is contained in:
@ -24,6 +24,7 @@ namespace FreeSql.PostgreSQL.Curd
|
||||
{
|
||||
_pgsqlInsert = insert as PostgreSQLInsert<T1>;
|
||||
if (_pgsqlInsert == null) throw new Exception("OnConflictDoUpdate 是 FreeSql.Provider.PostgreSQL 特有的功能");
|
||||
if (_pgsqlInsert._noneParameterFlag == "c") _pgsqlInsert._noneParameterFlag = "cu";
|
||||
|
||||
if (columns != null)
|
||||
{
|
||||
|
@ -35,6 +35,7 @@ namespace FreeSql.PostgreSQL.Curd
|
||||
.WithTransaction(_transaction)
|
||||
.NoneParameter(true) as Internal.CommonProvider.InsertProvider<T1>;
|
||||
insert._source = data;
|
||||
insert._noneParameterFlag = flagInsert ? "cuc" : "cu";
|
||||
|
||||
string sql = "";
|
||||
if (IdentityColumn != null && flagInsert) sql = insert.ToSql();
|
||||
|
@ -163,7 +163,7 @@ namespace FreeSql.PostgreSQL
|
||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
||||
|
||||
static ConcurrentDictionary<Type, bool> _dicIsAssignableFromPostgisGeometry = new ConcurrentDictionary<Type, bool>();
|
||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
|
||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, Type type, object value)
|
||||
{
|
||||
if (value == null) return "NULL";
|
||||
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
|
||||
@ -178,7 +178,7 @@ namespace FreeSql.PostgreSQL
|
||||
;
|
||||
}))
|
||||
{
|
||||
var pam = AppendParamter(specialParams, null, null, type, value);
|
||||
var pam = AppendParamter(specialParams, $"p_{specialParams?.Count}{specialParamFlag}", null, type, value);
|
||||
return pam.ParameterName;
|
||||
}
|
||||
value = getParamterValue(type, value);
|
||||
@ -199,7 +199,7 @@ namespace FreeSql.PostgreSQL
|
||||
{
|
||||
var item = valueArr.GetValue(a);
|
||||
if (a > 0) sb.Append(",");
|
||||
sb.Append(GetNoneParamaterSqlValue(specialParams, eleType, item));
|
||||
sb.Append(GetNoneParamaterSqlValue(specialParams, specialParamFlag, eleType, item));
|
||||
}
|
||||
sb.Append("]");
|
||||
var dbinfo = _orm.CodeFirst.GetDbInfo(type);
|
||||
|
Reference in New Issue
Block a user