mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Synchronous code
This commit is contained in:
@@ -16,6 +16,7 @@ namespace SqlSugar
|
|||||||
public bool DisableMillisecond { get; set; }
|
public bool DisableMillisecond { get; set; }
|
||||||
public bool PgSqlIsAutoToLower { get; set; } = true;
|
public bool PgSqlIsAutoToLower { get; set; } = true;
|
||||||
public bool PgSqlIsAutoToLowerCodeFirst { get; set; } = true;
|
public bool PgSqlIsAutoToLowerCodeFirst { get; set; } = true;
|
||||||
|
public bool PgSqlIsAutoToLowerSchema{ get; set; } = true;
|
||||||
public bool EnableILike { get; set; }
|
public bool EnableILike { get; set; }
|
||||||
public bool IsAutoToUpper { get; set; } = true;
|
public bool IsAutoToUpper { get; set; } = true;
|
||||||
public int DefaultCacheDurationInSeconds { get; set; }
|
public int DefaultCacheDurationInSeconds { get; set; }
|
||||||
|
@@ -603,23 +603,45 @@ WHERE tgrelid = '"+tableName+"'::regclass");
|
|||||||
private string GetSchema()
|
private string GetSchema()
|
||||||
{
|
{
|
||||||
var schema = "public";
|
var schema = "public";
|
||||||
if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), "searchpath="))
|
var pgSqlIsAutoToLowerSchema = this.Context?.CurrentConnectionConfig?.MoreSettings?.PgSqlIsAutoToLowerSchema == false;
|
||||||
|
if (pgSqlIsAutoToLowerSchema)
|
||||||
{
|
{
|
||||||
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"searchpath\=(\w+)").Groups[1].Value;
|
if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString, "searchpath=", RegexOptions.IgnoreCase))
|
||||||
if (regValue.HasValue())
|
|
||||||
{
|
{
|
||||||
schema = regValue;
|
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString, @"searchpath\=(\w+)").Groups[1].Value;
|
||||||
|
if (regValue.HasValue())
|
||||||
|
{
|
||||||
|
schema = regValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString, "search path=", RegexOptions.IgnoreCase))
|
||||||
|
{
|
||||||
|
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"search path\=(\w+)").Groups[1].Value;
|
||||||
|
if (regValue.HasValue())
|
||||||
|
{
|
||||||
|
schema = regValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), "search path="))
|
else
|
||||||
{
|
{
|
||||||
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"search path\=(\w+)").Groups[1].Value;
|
if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), "searchpath="))
|
||||||
if (regValue.HasValue())
|
|
||||||
{
|
{
|
||||||
schema = regValue;
|
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"searchpath\=(\w+)").Groups[1].Value;
|
||||||
|
if (regValue.HasValue())
|
||||||
|
{
|
||||||
|
schema = regValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), "search path="))
|
||||||
|
{
|
||||||
|
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"search path\=(\w+)").Groups[1].Value;
|
||||||
|
if (regValue.HasValue())
|
||||||
|
{
|
||||||
|
schema = regValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
private static void ConvertCreateColumnInfo(DbColumnInfo x)
|
private static void ConvertCreateColumnInfo(DbColumnInfo x)
|
||||||
|
@@ -728,7 +728,8 @@ namespace SqlSugar
|
|||||||
DisableQueryWhereColumnRemoveTrim=it.MoreSettings.DisableQueryWhereColumnRemoveTrim,
|
DisableQueryWhereColumnRemoveTrim=it.MoreSettings.DisableQueryWhereColumnRemoveTrim,
|
||||||
DatabaseModel=it.MoreSettings.DatabaseModel,
|
DatabaseModel=it.MoreSettings.DatabaseModel,
|
||||||
EnableILike=it.MoreSettings.EnableILike,
|
EnableILike=it.MoreSettings.EnableILike,
|
||||||
ClickHouseEnableFinal=it.MoreSettings.ClickHouseEnableFinal
|
ClickHouseEnableFinal=it.MoreSettings.ClickHouseEnableFinal,
|
||||||
|
PgSqlIsAutoToLowerSchema=it.MoreSettings.PgSqlIsAutoToLowerSchema
|
||||||
|
|
||||||
},
|
},
|
||||||
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
||||||
|
Reference in New Issue
Block a user