mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Add customized GetTableInfoList
This commit is contained in:
parent
2154ea96f3
commit
38b6a979ba
@ -37,6 +37,17 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public List<DbTableInfo> GetTableInfoList(Func<DbType,string, string> getChangeSqlFunc)
|
||||||
|
{
|
||||||
|
var db=this.Context.CopyNew();
|
||||||
|
db.Aop.OnExecutingChangeSql = (sql, pars) =>
|
||||||
|
{
|
||||||
|
sql= getChangeSqlFunc(this.Context.CurrentConnectionConfig.DbType, sql);
|
||||||
|
return new KeyValuePair<string, SugarParameter[]>(sql,pars);
|
||||||
|
};
|
||||||
|
var result= db.DbMaintenance.GetTableInfoList(false);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true)
|
public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true)
|
||||||
{
|
{
|
||||||
string cacheKey = "DbMaintenanceProvider.GetTableInfoList"+this.Context.CurrentConnectionConfig.ConfigId;
|
string cacheKey = "DbMaintenanceProvider.GetTableInfoList"+this.Context.CurrentConnectionConfig.ConfigId;
|
||||||
|
@ -13,6 +13,7 @@ namespace SqlSugar
|
|||||||
List<string> GetDataBaseList();
|
List<string> GetDataBaseList();
|
||||||
List<DbTableInfo> GetViewInfoList(bool isCache=true);
|
List<DbTableInfo> GetViewInfoList(bool isCache=true);
|
||||||
List<DbTableInfo> GetTableInfoList(bool isCache=true);
|
List<DbTableInfo> GetTableInfoList(bool isCache=true);
|
||||||
|
List<DbTableInfo> GetTableInfoList(Func<DbType, string, string> getChangeSqlFunc);
|
||||||
List<DbColumnInfo> GetColumnInfosByTableName(string tableName,bool isCache=true);
|
List<DbColumnInfo> GetColumnInfosByTableName(string tableName,bool isCache=true);
|
||||||
List<string> GetIsIdentities(string tableName);
|
List<string> GetIsIdentities(string tableName);
|
||||||
List<string> GetPrimaries(string tableName);
|
List<string> GetPrimaries(string tableName);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>SqlSugarCore</id>
|
<id>SqlSugarCore</id>
|
||||||
<version>5.1.4.143</version>
|
<version>5.1.4.144-preview10</version>
|
||||||
<authors>sunkaixuan</authors>
|
<authors>sunkaixuan</authors>
|
||||||
<owners>果糖大数据科技</owners>
|
<owners>果糖大数据科技</owners>
|
||||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||||
|
Loading…
Reference in New Issue
Block a user