mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-09 23:27:59 +08:00
Add: drop view , drop function, drop proc
This commit is contained in:
parent
03209b088c
commit
f1e3bda568
@ -166,6 +166,24 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DDL
|
#region DDL
|
||||||
|
public virtual bool DropView(string viewName)
|
||||||
|
{
|
||||||
|
viewName = this.SqlBuilder.GetNoTranslationColumnName(viewName);
|
||||||
|
this.Context.Ado.ExecuteCommand($" DROP VIEW {viewName} ");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public virtual bool DropFunction(string funcName)
|
||||||
|
{
|
||||||
|
funcName = this.SqlBuilder.GetNoTranslationColumnName(funcName);
|
||||||
|
this.Context.Ado.ExecuteCommand($" DROP FUNCTION {funcName} ");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public virtual bool DropProc(string procName)
|
||||||
|
{
|
||||||
|
procName = this.SqlBuilder.GetNoTranslationColumnName(procName);
|
||||||
|
this.Context.Ado.ExecuteCommand($" DROP PROCEDURE {procName} ");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///by current connection string
|
///by current connection string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -37,7 +37,10 @@ namespace SqlSugar
|
|||||||
bool CreateIndex(string tableName, string [] columnNames, bool isUnique=false);
|
bool CreateIndex(string tableName, string [] columnNames, bool isUnique=false);
|
||||||
bool CreateIndex(string tableName, string[] columnNames, string IndexName, bool isUnique = false);
|
bool CreateIndex(string tableName, string[] columnNames, string IndexName, bool isUnique = false);
|
||||||
bool DropTable(string tableName);
|
bool DropTable(string tableName);
|
||||||
bool DropTable(params string[] tableName);
|
bool DropView(string viewName);
|
||||||
|
bool DropFunction(string funcName);
|
||||||
|
bool DropProc(string procName);
|
||||||
|
; bool DropTable(params string[] tableName);
|
||||||
bool DropTable(params Type[] tableEntityTypes);
|
bool DropTable(params Type[] tableEntityTypes);
|
||||||
bool DropTable<T>();
|
bool DropTable<T>();
|
||||||
bool DropTable<T,T2>();
|
bool DropTable<T,T2>();
|
||||||
|
Loading…
Reference in New Issue
Block a user