mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update PGSQL
This commit is contained in:
parent
043c8fa20b
commit
861f2fda39
@ -117,7 +117,7 @@ namespace SqlSugar
|
||||
After(sql, null);
|
||||
return result;
|
||||
}
|
||||
public async Task<int> ExecuteReturnIdentityAsync()
|
||||
public virtual async Task<int> ExecuteReturnIdentityAsync()
|
||||
{
|
||||
if (this.InsertObjs.Count() == 1 && this.InsertObjs.First() == null)
|
||||
{
|
||||
@ -149,7 +149,7 @@ namespace SqlSugar
|
||||
this.Context.EntityMaintenance.GetProperty<T>(identityKey).SetValue(result, setValue, null);
|
||||
return idValue > 0;
|
||||
}
|
||||
public async Task<long> ExecuteReturnBigIdentityAsync()
|
||||
public virtual async Task<long> ExecuteReturnBigIdentityAsync()
|
||||
{
|
||||
if (this.InsertObjs.Count() == 1 && this.InsertObjs.First() == null)
|
||||
{
|
||||
|
@ -18,6 +18,16 @@ namespace SqlSugar
|
||||
var result = Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()).ObjToInt();
|
||||
return result;
|
||||
}
|
||||
public override async Task<int> ExecuteReturnIdentityAsync()
|
||||
{
|
||||
InsertBuilder.IsReturnIdentity = true;
|
||||
PreToSql();
|
||||
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetPrimaryKeys().FirstOrDefault());
|
||||
RestoreMapping();
|
||||
var obj = await Ado.GetScalarAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||
var result = obj.ObjToInt();
|
||||
return result;
|
||||
}
|
||||
public override KeyValuePair<string, List<SugarParameter>> ToSql()
|
||||
{
|
||||
var result= base.ToSql();
|
||||
@ -33,6 +43,15 @@ namespace SqlSugar
|
||||
var result = Convert.ToInt64(Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()) ?? "0");
|
||||
return result;
|
||||
}
|
||||
public override async Task<long> ExecuteReturnBigIdentityAsync()
|
||||
{
|
||||
InsertBuilder.IsReturnIdentity = true;
|
||||
PreToSql();
|
||||
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetPrimaryKeys().FirstOrDefault());
|
||||
RestoreMapping();
|
||||
var result = Convert.ToInt64(await Ado.GetScalarAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()) ?? "0");
|
||||
return result;
|
||||
}
|
||||
|
||||
public override bool ExecuteCommandIdentityIntoEntity()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user