Browse Source

Synchronization code

pull/25/head
sunkaixuan 2 years ago
parent
commit
ea25430564
  1. 4
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs
  2. 8
      Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs
  3. 1
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs
  4. 11
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLQueryBuilder.cs
  5. 7
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLUpdateBuilder.cs

4
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

@ -893,6 +893,10 @@ namespace SqlSugar
ShortName = lastPareamter.Name,
TableName = this.Context.EntityMaintenance.GetTableName(lastPareamter.Type)
};
if (this.Context.CurrentConnectionConfig?.MoreSettings?.PgSqlIsAutoToLower == false)
{
result.ShortName = this.SqlBuilder.GetTranslationColumnName(result.ShortName);
}
if (result.JoinIndex == 0)
{
var firstPareamter = (express as LambdaExpression).Parameters.First();

8
Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs

@ -25,10 +25,10 @@ namespace SqlSugar
{
mySqlConnectionString = mySqlConnectionString.Trim().TrimEnd(';') + ";charset=utf8;";
}
if (!mySqlConnectionString.ToLower().Contains("min"))
{
mySqlConnectionString = mySqlConnectionString.Trim().TrimEnd(';') + ";min pool size=1";
}
//if (!mySqlConnectionString.ToLower().Contains("min"))
//{
// mySqlConnectionString = mySqlConnectionString.Trim().TrimEnd(';') + ";min pool size=1";
//}
base._DbConnection = new MySqlConnection(mySqlConnectionString);
}
catch (Exception ex)

1
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs

@ -64,6 +64,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("int2",CSharpDataType.@short),
new KeyValuePair<string, CSharpDataType>("smallint",CSharpDataType.@short),
new KeyValuePair<string, CSharpDataType>("int4",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("serial",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("integer",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("int8",CSharpDataType.@long),
new KeyValuePair<string, CSharpDataType>("bigint",CSharpDataType.@long),

11
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLQueryBuilder.cs

@ -29,6 +29,17 @@ namespace SqlSugar
#endregion
#region Common Methods
public override string GetTableNameString
{
get
{
if (this.TableShortName != null&&this.Context.CurrentConnectionConfig?.MoreSettings?.PgSqlIsAutoToLower==false)
{
this.TableShortName = Builder.GetTranslationColumnName(this.TableShortName);
}
return base.GetTableNameString;
}
}
public override bool IsComplexModel(string sql)
{
return Regex.IsMatch(sql, @"AS ""\w+\.\w+""")|| Regex.IsMatch(sql, @"AS ""\w+\.\w+\.\w+""");

7
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLUpdateBuilder.cs

@ -143,6 +143,13 @@ namespace SqlSugar
var dbType = columnInfo?.DataType;
if (dbType == null) {
var typeName = it.PropertyType.Name.ToLower();
if (columnInfo==null&&it.PropertyType.IsEnum)
{
if (this.Context.CurrentConnectionConfig?.MoreSettings?.TableEnumIsString!=true)
{
typeName = "int";
}
}
if (typeName == "int32")
typeName = "int";
if (typeName == "int64")

Loading…
Cancel
Save