Synchronization code

This commit is contained in:
sunkaixuan
2023-10-11 18:46:01 +08:00
parent b681dcccb4
commit fc844743f4
4 changed files with 22 additions and 2 deletions

View File

@@ -51,6 +51,11 @@ namespace SqlSugar
// 获取对象中的属性
PropertyInfo propertyInfo = type.GetProperty(pair.Key);
if (propertyInfo == null)
{
propertyInfo = type.GetProperties().FirstOrDefault(it=>it.Name.EqualCase(pair.Key));
}
if (propertyInfo != null)
{
propertyInfo.SetValue(obj, UtilMethods.ChangeType2(pair.Value, propertyInfo.PropertyType));

View File

@@ -421,7 +421,7 @@ namespace SqlSugar
}
return false;
}
private static void CheckDbDependency(ConnectionConfig config)
private void CheckDbDependency(ConnectionConfig config)
{
switch (config.DbType)
{
@@ -491,6 +491,14 @@ namespace SqlSugar
case DbType.GaussDB:
config.DbType = DbType.PostgreSQL;
break;
case DbType.Vastbase:
config.DbType = DbType.PostgreSQL;
if (this.TempItems == null)
{
this.TempItems = new Dictionary<string, object>();
}
this.TempItems.Add("DbType.Vastbase", "DbType.Vastbase");
break;
case DbType.OceanBase:
config.DbType = DbType.MySql;
break;

View File

@@ -28,6 +28,7 @@ namespace SqlSugar
GaussDB,
OceanBase,
Tidb,
Vastbase,
Custom =900
}
}

View File

@@ -377,7 +377,13 @@ WHERE tgrelid = '"+tableName+"'::regclass");
});
if (!GetDataBaseList(newDb).Any(it => it.Equals(databaseName, StringComparison.CurrentCultureIgnoreCase)))
{
newDb.Ado.ExecuteCommand(string.Format(CreateDataBaseSql, this.SqlBuilder.SqlTranslationLeft+databaseName+this.SqlBuilder.SqlTranslationRight, databaseDirectory));
var isVast = this.Context?.TempItems?.ContainsKey("DbType.Vastbase")==true;
var dbcompatibility = "";
if (isVast)
{
dbcompatibility=" dbcompatibility = 'PG'";
}
newDb.Ado.ExecuteCommand(string.Format(CreateDataBaseSql, this.SqlBuilder.SqlTranslationLeft+databaseName+this.SqlBuilder.SqlTranslationRight, databaseDirectory)+ dbcompatibility);
}
return true;
}