mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 18:34:55 +08:00
Update HG
This commit is contained in:
@@ -11,12 +11,10 @@ namespace SqlSugar.HG
|
|||||||
{
|
{
|
||||||
public class HGFastBuilder : FastBuilder, IFastBuilder
|
public class HGFastBuilder : FastBuilder, IFastBuilder
|
||||||
{
|
{
|
||||||
public static Dictionary<string , NhgdbDbType> PgSqlType = UtilMethods.EnumToDictionary<NhgdbDbType>();
|
public static Dictionary<string, NhgdbDbType> PgSqlType = UtilMethods.EnumToDictionary<NhgdbDbType>();
|
||||||
private EntityInfo entityInfo;
|
|
||||||
|
|
||||||
public HGFastBuilder(EntityInfo entityInfo)
|
public HGFastBuilder()
|
||||||
{
|
{
|
||||||
this.entityInfo = entityInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string UpdateSql { get; set; } = @"UPDATE {1} SET {0} FROM {2} AS TE WHERE {3}
|
public override string UpdateSql { get; set; } = @"UPDATE {1} SET {0} FROM {2} AS TE WHERE {3}
|
||||||
@@ -40,10 +38,10 @@ namespace SqlSugar.HG
|
|||||||
}
|
}
|
||||||
string copyString = $"COPY {dt.TableName} ( {string.Join(",", lsColNames) } ) FROM STDIN (FORMAT BINARY)";
|
string copyString = $"COPY {dt.TableName} ( {string.Join(",", lsColNames) } ) FROM STDIN (FORMAT BINARY)";
|
||||||
NhgdbConnection conn = (NhgdbConnection)this.Context.Ado.Connection;
|
NhgdbConnection conn = (NhgdbConnection)this.Context.Ado.Connection;
|
||||||
var columns = this.Context.DbMaintenance.GetColumnInfosByTableName(this.entityInfo.DbTableName);
|
var columns = this.Context.DbMaintenance.GetColumnInfosByTableName(this.FastEntityInfo.DbTableName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var identityColumnInfo = this.entityInfo.Columns.FirstOrDefault(it => it.IsIdentity);
|
var identityColumnInfo = this.FastEntityInfo.Columns.FirstOrDefault(it => it.IsIdentity);
|
||||||
if (identityColumnInfo != null)
|
if (identityColumnInfo != null)
|
||||||
{
|
{
|
||||||
throw new Exception("PgSql bulkcopy no support identity");
|
throw new Exception("PgSql bulkcopy no support identity");
|
||||||
@@ -71,7 +69,7 @@ namespace SqlSugar.HG
|
|||||||
ColumnView result = new ColumnView();
|
ColumnView result = new ColumnView();
|
||||||
result.DbColumnInfo = columns.FirstOrDefault(it => it.DbColumnName?.ToLower()==item.ColumnName?.ToLower());
|
result.DbColumnInfo = columns.FirstOrDefault(it => it.DbColumnName?.ToLower()==item.ColumnName?.ToLower());
|
||||||
result.DataColumn = item;
|
result.DataColumn = item;
|
||||||
result.EntityColumnInfo=this.entityInfo.Columns.FirstOrDefault(it => it.DbColumnName?.ToLower()==item.ColumnName?.ToLower());
|
result.EntityColumnInfo=this.FastEntityInfo.Columns.FirstOrDefault(it => it.DbColumnName?.ToLower()==item.ColumnName?.ToLower());
|
||||||
var key = result.DbColumnInfo?.DataType?.ToLower();
|
var key = result.DbColumnInfo?.DataType?.ToLower();
|
||||||
if (result.DbColumnInfo == null)
|
if (result.DbColumnInfo == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user