mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 增加 Column 特性 RereadSql 重读功能;
This commit is contained in:
parent
1effade3b1
commit
76e8b3efce
@ -115,5 +115,16 @@ namespace FreeSql.DataAnnotations
|
|||||||
/// decimal/numeric 类型的小数位长度
|
/// decimal/numeric 类型的小数位长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Scale { get => _Scale ?? 0; set => _Scale = value; }
|
public int Scale { get => _Scale ?? 0; set => _Scale = value; }
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 写入格式化,比如 geography::STGeomFromText({0},4236)
|
||||||
|
///// </summary>
|
||||||
|
//public string AuditWriteSql { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 设置重读功能<para></para>
|
||||||
|
/// [Column(RereadSql = "{0}.STAsText()")]<para></para>
|
||||||
|
/// 查询:SELECT a.[id], a.[geo].STAsText() FROM table a
|
||||||
|
/// </summary>
|
||||||
|
public string RereadSql { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,13 @@
|
|||||||
decimal/numeric 类型的小数位长度
|
decimal/numeric 类型的小数位长度
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:FreeSql.DataAnnotations.ColumnAttribute.RereadSql">
|
||||||
|
<summary>
|
||||||
|
设置重读功能<para></para>
|
||||||
|
[Column(RereadSql = "{0}.STAsText()")]<para></para>
|
||||||
|
查询:SELECT a.[id], a.[geo].STAsText() FROM table a
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:FreeSql.DataAnnotations.ColumnFluent.Name(System.String)">
|
<member name="M:FreeSql.DataAnnotations.ColumnFluent.Name(System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
数据库列名
|
数据库列名
|
||||||
|
@ -131,7 +131,7 @@ namespace FreeSql.Internal
|
|||||||
CsType = map[idx].Column.CsType,
|
CsType = map[idx].Column.CsType,
|
||||||
MapType = map[idx].Column.Attribute.MapType
|
MapType = map[idx].Column.Attribute.MapType
|
||||||
};
|
};
|
||||||
field.Append(", ").Append(_common.QuoteReadColumn(child.CsType, child.MapType, child.DbField));
|
field.Append(", ").Append(_common.QuoteReadColumn(map[idx].Column, child.CsType, child.MapType, child.DbField));
|
||||||
if (index >= 0) field.Append(_common.FieldAsAlias($"as{++index}"));
|
if (index >= 0) field.Append(_common.FieldAsAlias($"as{++index}"));
|
||||||
parent.Childs.Add(child);
|
parent.Childs.Add(child);
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
if (tbiindex > 0 && colidx == 0) field.Append("\r\n");
|
if (tbiindex > 0 && colidx == 0) field.Append("\r\n");
|
||||||
}
|
}
|
||||||
var quoteName = _commonUtils.QuoteSqlName(col.Attribute.Name);
|
var quoteName = _commonUtils.QuoteSqlName(col.Attribute.Name);
|
||||||
field.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"{tbi.Alias}.{quoteName}"));
|
field.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"{tbi.Alias}.{quoteName}"));
|
||||||
++index;
|
++index;
|
||||||
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
||||||
else dicfield.Add(quoteName, true);
|
else dicfield.Add(quoteName, true);
|
||||||
@ -555,7 +555,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
{ //普通字段
|
{ //普通字段
|
||||||
if (index > 0) field.Append(", ");
|
if (index > 0) field.Append(", ");
|
||||||
var quoteName = _commonUtils.QuoteSqlName(col.Attribute.Name);
|
var quoteName = _commonUtils.QuoteSqlName(col.Attribute.Name);
|
||||||
field.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"{tb.Alias}.{quoteName}"));
|
field.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"{tb.Alias}.{quoteName}"));
|
||||||
++index;
|
++index;
|
||||||
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
||||||
else dicfield.Add(quoteName, true);
|
else dicfield.Add(quoteName, true);
|
||||||
@ -578,7 +578,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
{
|
{
|
||||||
if (index > 0) field.Append(", ");
|
if (index > 0) field.Append(", ");
|
||||||
var quoteName = _commonUtils.QuoteSqlName(col2.Attribute.Name);
|
var quoteName = _commonUtils.QuoteSqlName(col2.Attribute.Name);
|
||||||
field.Append(_commonUtils.QuoteReadColumn(col2.CsType, col2.Attribute.MapType, $"{tb2.Alias}.{quoteName}"));
|
field.Append(_commonUtils.QuoteReadColumn(col2, col2.CsType, col2.Attribute.MapType, $"{tb2.Alias}.{quoteName}"));
|
||||||
++index;
|
++index;
|
||||||
++otherindex;
|
++otherindex;
|
||||||
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
if (dicfield.ContainsKey(quoteName)) field.Append(_commonUtils.FieldAsAlias($"as{index}"));
|
||||||
|
@ -1025,7 +1025,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
Property = tbrefMid.Properties[col.CsName]
|
Property = tbrefMid.Properties[col.CsName]
|
||||||
};
|
};
|
||||||
read.Childs.Add(child);
|
read.Childs.Add(child);
|
||||||
field.Append(", ").Append(_commonUtils.QuoteReadColumn(child.CsType, child.MapType, child.DbField));
|
field.Append(", ").Append(_commonUtils.QuoteReadColumn(col, child.CsType, child.MapType, child.DbField));
|
||||||
}
|
}
|
||||||
otherData = new ReadAnonymousTypeAfInfo(read, field.ToString());
|
otherData = new ReadAnonymousTypeAfInfo(read, field.ToString());
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,14 @@ namespace FreeSql.Internal
|
|||||||
public abstract string Now { get; }
|
public abstract string Now { get; }
|
||||||
public abstract string NowUtc { get; }
|
public abstract string NowUtc { get; }
|
||||||
public abstract string QuoteWriteParamter(Type type, string paramterName);
|
public abstract string QuoteWriteParamter(Type type, string paramterName);
|
||||||
public abstract string QuoteReadColumn(Type type, Type mapType, string columnName);
|
protected abstract string QuoteReadColumnAdapter(Type type, Type mapType, string columnName);
|
||||||
|
public string QuoteReadColumn(ColumnInfo col, Type type, Type mapType, string columnName)
|
||||||
|
{
|
||||||
|
var result = QuoteReadColumnAdapter(type, mapType, columnName);
|
||||||
|
if (string.IsNullOrWhiteSpace(col?.Attribute.RereadSql) == false)
|
||||||
|
return string.Format(col.Attribute.RereadSql, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public virtual string FieldAsAlias(string alias) => $" {alias}";
|
public virtual string FieldAsAlias(string alias) => $" {alias}";
|
||||||
public virtual string IIF(string test, string ifTrue, string ifElse) => $"case when {test} then {ifTrue} else {ifElse} end";
|
public virtual string IIF(string test, string ifTrue, string ifElse) => $"case when {test} then {ifTrue} else {ifElse} end";
|
||||||
public static string BytesSqlRaw(byte[] bytes)
|
public static string BytesSqlRaw(byte[] bytes)
|
||||||
|
@ -32,7 +32,7 @@ namespace FreeSql.Dameng.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -40,7 +40,7 @@ namespace FreeSql.Dameng.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.Dameng
|
|||||||
public override string NowUtc => "getutcdate";
|
public override string NowUtc => "getutcdate";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -97,7 +97,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -197,7 +197,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -34,7 +34,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"new.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"new.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -66,7 +66,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("CONCAT(");
|
caseWhen.Append("CONCAT(");
|
||||||
@ -74,7 +74,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(", '+', ");
|
if (pkidx > 0) caseWhen.Append(", '+', ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -115,7 +115,7 @@ namespace FreeSql.Firebird.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"new.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"new.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -80,7 +80,7 @@ namespace FreeSql.Firebird
|
|||||||
public override string NowUtc => "current_timestamp";
|
public override string NowUtc => "current_timestamp";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -188,7 +188,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -42,7 +42,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -75,7 +75,7 @@ namespace FreeSql.KingbaseES
|
|||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -84,7 +84,7 @@ namespace FreeSql.KingbaseES
|
|||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -139,7 +139,7 @@ namespace FreeSql.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -122,7 +122,7 @@ namespace FreeSql.KingbaseES
|
|||||||
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ namespace FreeSql.MsAccess.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -45,7 +45,7 @@ namespace FreeSql.MsAccess.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
||||||
caseWhen.Append(MsAccessUtils.GetCastSql(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)), typeof(string)));
|
caseWhen.Append(MsAccessUtils.GetCastSql(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)), typeof(string)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -78,7 +78,7 @@ namespace FreeSql.MsAccess
|
|||||||
public override string NowUtc => "now()";
|
public override string NowUtc => "now()";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
public override string FieldAsAlias(string alias) => $" as {alias}";
|
public override string FieldAsAlias(string alias) => $" as {alias}";
|
||||||
public override string IIF(string test, string ifTrue, string ifElse) => $"iif({test}, {ifTrue}, {ifElse})";
|
public override string IIF(string test, string ifTrue, string ifElse) => $"iif({test}, {ifTrue}, {ifElse})";
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -80,7 +80,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -149,7 +149,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -41,7 +41,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -73,7 +73,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("CONCAT(");
|
caseWhen.Append("CONCAT(");
|
||||||
@ -81,7 +81,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(", '+', ");
|
if (pkidx > 0) caseWhen.Append(", '+', ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -122,7 +122,7 @@ namespace FreeSql.MySql.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -112,7 +112,7 @@ namespace FreeSql.MySql
|
|||||||
}
|
}
|
||||||
return paramterName;
|
return paramterName;
|
||||||
}
|
}
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName)
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName)
|
||||||
{
|
{
|
||||||
switch (mapType.FullName)
|
switch (mapType.FullName)
|
||||||
{
|
{
|
||||||
|
@ -132,7 +132,7 @@ namespace FreeSql.MySql
|
|||||||
}
|
}
|
||||||
return paramterName;
|
return paramterName;
|
||||||
}
|
}
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName)
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName)
|
||||||
{
|
{
|
||||||
switch (mapType.FullName)
|
switch (mapType.FullName)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace FreeSql.Odbc.Dameng
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -41,7 +41,7 @@ namespace FreeSql.Odbc.Dameng
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -97,7 +97,7 @@ namespace FreeSql.Odbc.Dameng
|
|||||||
public override string NowUtc => "getutcdate";
|
public override string NowUtc => "getutcdate";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace FreeSql.Odbc.Default
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -38,7 +38,7 @@ namespace FreeSql.Odbc.Default
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
||||||
caseWhen.Append(_utils.Adapter.CastSql(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)), _utils.Adapter.MappingOdbcTypeVarChar));
|
caseWhen.Append(_utils.Adapter.CastSql(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)), _utils.Adapter.MappingOdbcTypeVarChar));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -67,7 +67,7 @@ namespace FreeSql.Odbc.Default
|
|||||||
public override string NowUtc => Adapter.LambdaDateTime_UtcNow;
|
public override string NowUtc => Adapter.LambdaDateTime_UtcNow;
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => Adapter.FieldSql(type, columnName);
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => Adapter.FieldSql(type, columnName);
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -188,7 +188,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -42,7 +42,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -75,7 +75,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -84,7 +84,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -139,7 +139,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -121,7 +121,7 @@ namespace FreeSql.Odbc.KingbaseES
|
|||||||
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -92,7 +92,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -172,7 +172,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -41,7 +41,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -73,7 +73,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("CONCAT(");
|
caseWhen.Append("CONCAT(");
|
||||||
@ -81,7 +81,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(", '+', ");
|
if (pkidx > 0) caseWhen.Append(", '+', ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -122,7 +122,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -79,7 +79,7 @@ namespace FreeSql.Odbc.MySql
|
|||||||
}
|
}
|
||||||
return paramterName;
|
return paramterName;
|
||||||
}
|
}
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName)
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName)
|
||||||
{
|
{
|
||||||
switch (mapType.FullName)
|
switch (mapType.FullName)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace FreeSql.Odbc.Oracle
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -41,7 +41,7 @@ namespace FreeSql.Odbc.Oracle
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -97,7 +97,7 @@ namespace FreeSql.Odbc.Oracle
|
|||||||
public override string NowUtc => "sys_extract_utc(systimestamp)";
|
public override string NowUtc => "sys_extract_utc(systimestamp)";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -188,7 +188,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -42,7 +42,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -75,7 +75,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -84,7 +84,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -139,7 +139,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -121,7 +121,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
|||||||
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -79,7 +79,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
||||||
caseWhen.Append("cast(").Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append(" as varchar)");
|
caseWhen.Append("cast(").Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append(" as varchar)");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -117,7 +117,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ namespace FreeSql.Odbc.SqlServer
|
|||||||
public override string NowUtc => "getutcdate()";
|
public override string NowUtc => "getutcdate()";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace FreeSql.Oracle.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -41,7 +41,7 @@ namespace FreeSql.Oracle.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -98,7 +98,7 @@ namespace FreeSql.Oracle
|
|||||||
public override string NowUtc => "sys_extract_utc(systimestamp)";
|
public override string NowUtc => "sys_extract_utc(systimestamp)";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -188,7 +188,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -42,7 +42,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -75,7 +75,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -84,7 +84,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -139,7 +139,7 @@ namespace FreeSql.PostgreSQL.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -160,7 +160,7 @@ namespace FreeSql.PostgreSQL
|
|||||||
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
static ConcurrentDictionary<Type, bool> _dicIsAssignableFromPostgisGeometry = new ConcurrentDictionary<Type, bool>();
|
static ConcurrentDictionary<Type, bool> _dicIsAssignableFromPostgisGeometry = new ConcurrentDictionary<Type, bool>();
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
|
@ -28,7 +28,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -69,7 +69,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -96,7 +96,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -188,7 +188,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -43,7 +43,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
@ -76,7 +76,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -85,7 +85,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
if (string.IsNullOrEmpty(InternalTableAlias) == false) caseWhen.Append(InternalTableAlias).Append(".");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append("::text");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -140,7 +140,7 @@ namespace FreeSql.ShenTong.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, _commonUtils.QuoteSqlName(col.Attribute.Name))).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
sql = sb.ToString();
|
sql = sb.ToString();
|
||||||
|
@ -135,7 +135,7 @@ namespace FreeSql.ShenTong
|
|||||||
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
public override string NowUtc => "(current_timestamp at time zone 'UTC')";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"DELETED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -80,7 +80,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
if (pkidx > 0) caseWhen.Append(" + '+' + ");
|
||||||
caseWhen.Append("cast(").Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append(" as varchar)");
|
caseWhen.Append("cast(").Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name))).Append(" as varchar)");
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
@ -118,7 +118,7 @@ namespace FreeSql.SqlServer.Curd
|
|||||||
foreach (var col in _table.Columns.Values)
|
foreach (var col in _table.Columns.Values)
|
||||||
{
|
{
|
||||||
if (colidx > 0) sb.Append(", ");
|
if (colidx > 0) sb.Append(", ");
|
||||||
sb.Append(_commonUtils.QuoteReadColumn(col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
sb.Append(_commonUtils.QuoteReadColumn(col, col.CsType, col.Attribute.MapType, $"INSERTED.{_commonUtils.QuoteSqlName(col.Attribute.Name)}")).Append(" as ").Append(_commonUtils.QuoteSqlName(col.CsName));
|
||||||
++colidx;
|
++colidx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ namespace FreeSql.SqlServer
|
|||||||
public override string NowUtc => "getutcdate()";
|
public override string NowUtc => "getutcdate()";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace FreeSql.Sqlite.Curd
|
|||||||
if (_table.Primarys.Length == 1)
|
if (_table.Primarys.Length == 1)
|
||||||
{
|
{
|
||||||
var pk = _table.Primarys.First();
|
var pk = _table.Primarys.First();
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
caseWhen.Append("(");
|
caseWhen.Append("(");
|
||||||
@ -41,7 +41,7 @@ namespace FreeSql.Sqlite.Curd
|
|||||||
foreach (var pk in _table.Primarys)
|
foreach (var pk in _table.Primarys)
|
||||||
{
|
{
|
||||||
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
if (pkidx > 0) caseWhen.Append(" || '+' || ");
|
||||||
caseWhen.Append(_commonUtils.QuoteReadColumn(pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
caseWhen.Append(_commonUtils.QuoteReadColumn(pk, pk.CsType, pk.Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)));
|
||||||
++pkidx;
|
++pkidx;
|
||||||
}
|
}
|
||||||
caseWhen.Append(")");
|
caseWhen.Append(")");
|
||||||
|
@ -100,7 +100,7 @@ namespace FreeSql.Sqlite
|
|||||||
public override string NowUtc => "current_timestamp";
|
public override string NowUtc => "current_timestamp";
|
||||||
|
|
||||||
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
public override string QuoteWriteParamter(Type type, string paramterName) => paramterName;
|
||||||
public override string QuoteReadColumn(Type type, Type mapType, string columnName) => columnName;
|
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;
|
||||||
|
|
||||||
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user