mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 09:44:39 +08:00
Synchronization code
This commit is contained in:
@@ -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));
|
||||
|
@@ -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;
|
||||
|
@@ -28,6 +28,7 @@ namespace SqlSugar
|
||||
GaussDB,
|
||||
OceanBase,
|
||||
Tidb,
|
||||
Vastbase,
|
||||
Custom =900
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user