- 优化 NoneParameter Oracle 文本超长的问题;

This commit is contained in:
28810
2020-08-10 17:57:29 +08:00
parent d602dfbaaa
commit 93562fd802
39 changed files with 129 additions and 249 deletions

View File

@ -35,6 +35,7 @@ namespace FreeSql.Odbc.PostgreSQL
.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();

View File

@ -24,6 +24,7 @@ namespace FreeSql.Odbc.PostgreSQL
{
_pgsqlInsert = insert as OdbcPostgreSQLInsert<T1>;
if (_pgsqlInsert == null) throw new Exception("OnConflictDoUpdate 是 FreeSql.Provider.Odbc/PostgreSQL 特有的功能");
if (_pgsqlInsert._noneParameterFlag == "c") _pgsqlInsert._noneParameterFlag = "cu";
if (columns != null)
{

View File

@ -123,7 +123,7 @@ namespace FreeSql.Odbc.PostgreSQL
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
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);
@ -145,7 +145,7 @@ namespace FreeSql.Odbc.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);