File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -870,3 +870,28 @@ def save_attachment_to_message(
870
870
except Exception as e :
871
871
print (f"Error saving attachment: { str (e )} " )
872
872
return False
873
+
874
+ def get_available_tables (db_path : str ) -> str :
875
+ """
876
+ Function Description:
877
+ This function gets the available tables in the database.
878
+ Args:
879
+ db_path (str): The database path.
880
+ Keyword Args:
881
+ None
882
+ Returns:
883
+ str: The available tables in the database.
884
+ """
885
+
886
+ try :
887
+ with sqlite3 .connect (db_path ) as conn :
888
+ cursor = conn .cursor ()
889
+ cursor .execute (
890
+ "SELECT name FROM sqlite_master WHERE type='table' AND name != 'command_history'"
891
+ )
892
+ tables = cursor .fetchall ()
893
+
894
+ return tables
895
+ except Exception as e :
896
+ print (f"Error getting available tables: { e } " )
897
+ return ""
You can’t perform that action at this time.
0 commit comments