mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 21:19:34 +08:00
Synchronization code
This commit is contained in:
parent
a8da11a4b2
commit
74fc30ba80
@ -40,6 +40,7 @@ namespace SqlSugar
|
||||
public List<DbTableInfo> GetTableInfoList(Func<DbType,string, string> getChangeSqlFunc)
|
||||
{
|
||||
var db=this.Context.CopyNew();
|
||||
db.CurrentConnectionConfig.IsAutoCloseConnection = true;
|
||||
db.Aop.OnExecutingChangeSql = (sql, pars) =>
|
||||
{
|
||||
sql= getChangeSqlFunc(this.Context.CurrentConnectionConfig.DbType, sql);
|
||||
@ -66,6 +67,7 @@ namespace SqlSugar
|
||||
public List<DbColumnInfo> GetColumnInfosByTableName(string tableName, Func<DbType, string, string> getChangeSqlFunc)
|
||||
{
|
||||
var db = this.Context.CopyNew();
|
||||
db.CurrentConnectionConfig.IsAutoCloseConnection = true;
|
||||
db.Aop.OnExecutingChangeSql = (sql, pars) =>
|
||||
{
|
||||
sql = getChangeSqlFunc(this.Context.CurrentConnectionConfig.DbType, sql);
|
||||
|
@ -214,11 +214,15 @@ namespace SqlSugar
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
foreach (var item in TableNames.GroupBy(it=>it.Key).Select(it=>it).ToDictionary(it=>it.Key,it=>it.First().Value))
|
||||
{
|
||||
if (!this.Context.CopyNew().DbMaintenance.IsAnyTable(item.Key, false))
|
||||
var newDb = this.Context.CopyNew();
|
||||
newDb.CurrentConnectionConfig.IsAutoCloseConnection = true;
|
||||
if (!newDb.DbMaintenance.IsAnyTable(item.Key, false))
|
||||
{
|
||||
lock (SplitLockObj)
|
||||
{
|
||||
if (!this.Context.CopyNew().DbMaintenance.IsAnyTable(item.Key, false))
|
||||
var newDb2 = this.Context.CopyNew();
|
||||
newDb2.CurrentConnectionConfig.IsAutoCloseConnection = true;
|
||||
if (!newDb2.DbMaintenance.IsAnyTable(item.Key, false))
|
||||
{
|
||||
if (item.Value != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user