File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
BotSharp.Plugin.ExcelHandler/Services
BotSharp.Plugin.SqlDriver/Functions Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ public IEnumerable<SqlContextOut> WriteExcelDataToDB(IWorkbook workbook)
9090 {
9191 var numTables = workbook . NumberOfSheets ;
9292 var commandList = new List < SqlContextOut > ( ) ;
93+ var state = _services . GetRequiredService < IConversationStateService > ( ) ;
9394
9495 for ( int sheetIdx = 0 ; sheetIdx < numTables ; sheetIdx ++ )
9596 {
@@ -109,15 +110,17 @@ public IEnumerable<SqlContextOut> WriteExcelDataToDB(IWorkbook workbook)
109110 commandList . Add ( commandResult ) ;
110111 continue ;
111112 }
112- var ( isInsertSuccess , insertMessage ) = SqlInsertDataFn ( sheet ) ;
113113
114114 string table = $ "{ _database } .{ _tableName } ";
115+ state . SetState ( "tmp_table" , table ) ;
116+
117+ var ( isInsertSuccess , insertMessage ) = SqlInsertDataFn ( sheet ) ;
115118 string exampleData = GetInsertExample ( table ) ;
116119
117120 commandResult = new SqlContextOut
118121 {
119122 isSuccessful = isInsertSuccess ,
120- Message = $ "{ insertMessage } \r \n Example Data: { exampleData } ",
123+ Message = $ "{ insertMessage } \r \n Example Data: { exampleData } . \r \n The remaining data contains different values. ",
121124 FileName = _currentFileName
122125 } ;
123126 commandList . Add ( commandResult ) ;
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ public async Task<bool> Execute(RoleDialogModel message)
4141 _ => throw new NotImplementedException ( $ "Database type { settings . DatabaseType } is not supported.")
4242 } ;
4343
44+ if ( refinedArgs . SqlStatements . Length == 1 && refinedArgs . SqlStatements [ 0 ] . StartsWith ( "DROP TABLE" ) )
45+ {
46+ message . Content = "Drop table successfully" ;
47+ return true ;
48+ }
49+
4450 if ( results . Count ( ) == 0 )
4551 {
4652 message . Content = "No record found" ;
You can’t perform that action at this time.
0 commit comments