mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Update 人大金仓【mysql】
This commit is contained in:
@@ -69,6 +69,8 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else if (IsMySql())
|
else if (IsMySql())
|
||||||
{
|
{
|
||||||
|
sql = sql.Replace("UPPER(", "pg_catalog.upper(",StringComparison.OrdinalIgnoreCase);
|
||||||
|
sql = sql.Replace("lower(", "pg_catalog.lower(", StringComparison.OrdinalIgnoreCase);
|
||||||
sql = sql.Replace("pcolumn.udt_name", "pcolumn.data_type");
|
sql = sql.Replace("pcolumn.udt_name", "pcolumn.data_type");
|
||||||
}
|
}
|
||||||
return sql;
|
return sql;
|
||||||
@@ -245,6 +247,11 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
sql = sql.Replace("sys_", "pg_");
|
sql = sql.Replace("sys_", "pg_");
|
||||||
}
|
}
|
||||||
|
if (IsSqlServerModel() || IsMySql())
|
||||||
|
{
|
||||||
|
sql = sql.Replace("UPPER(", "pg_catalog.upper(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
sql = sql.Replace("lower(", "pg_catalog.lower(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
return sql;
|
return sql;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,6 +359,11 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
|||||||
{
|
{
|
||||||
sql = sql.Replace("sys_", "pg_");
|
sql = sql.Replace("sys_", "pg_");
|
||||||
}
|
}
|
||||||
|
if (IsSqlServerModel() || IsMySql())
|
||||||
|
{
|
||||||
|
sql = sql.Replace("UPPER(", "pg_catalog.upper(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
sql = sql.Replace("lower(", "pg_catalog.lower(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
return this.Context.Ado.SqlQuery<string>(sql);
|
return this.Context.Ado.SqlQuery<string>(sql);
|
||||||
}
|
}
|
||||||
public override List<string> GetProcList(string dbName)
|
public override List<string> GetProcList(string dbName)
|
||||||
@@ -361,6 +373,11 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
|||||||
{
|
{
|
||||||
sql = sql.Replace("sys_", "pg_");
|
sql = sql.Replace("sys_", "pg_");
|
||||||
}
|
}
|
||||||
|
if (IsSqlServerModel() || IsMySql())
|
||||||
|
{
|
||||||
|
sql = sql.Replace("UPPER(", "pg_catalog.upper(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
sql = sql.Replace("lower(", "pg_catalog.lower(", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
return this.Context.Ado.SqlQuery<string>(sql);
|
return this.Context.Ado.SqlQuery<string>(sql);
|
||||||
}
|
}
|
||||||
private string GetSchema()
|
private string GetSchema()
|
||||||
@@ -440,10 +457,11 @@ WHERE tgrelid = '" + tableName + "'::regclass");
|
|||||||
public override bool IsAnyTable(string tableName, bool isCache = true)
|
public override bool IsAnyTable(string tableName, bool isCache = true)
|
||||||
{
|
{
|
||||||
var sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and UPPER(table_type)=UPPER('BASE TABLE') and UPPER(table_name)=UPPER('{tableName.ToUpper(IsUpper)}')";
|
var sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and UPPER(table_type)=UPPER('BASE TABLE') and UPPER(table_name)=UPPER('{tableName.ToUpper(IsUpper)}')";
|
||||||
if (IsSqlServerModel())
|
if (IsSqlServerModel()||IsMySql())
|
||||||
{
|
{
|
||||||
sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and pg_catalog.UPPER(table_name)=pg_catalog.UPPER('{tableName.ToUpper(IsUpper)}')";
|
sql = $"select count(*) from information_schema.tables where UPPER(table_schema)=UPPER('{GetSchema()}') and pg_catalog.UPPER(table_name)=pg_catalog.UPPER('{tableName.ToUpper(IsUpper)}')";
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.Context.Ado.GetInt(sql)>0;
|
return this.Context.Ado.GetInt(sql)>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user