0

I have an SQLAlchemy database that is having data added to it in real time. I want a way to be able to send a keyword or message in Teams and run an SQL call that will return in teams. It is the reverse of this post Send automated messages to Microsoft Teams using Python_

Does anyone know if this is possible? Here is my current SQL call:

from sqlalchemy import create_engine
import pandas as pd
link = "WEBHOOK_LINK"
myTeamsMessage = pymsteams.connectorcard(link)
pwd = "path_to_working_directory"
engine = create_engine(f'sqlite:///{pwd}\\database.db', echo=False)
pd.DataFrame(engine.execute("""
SELECT *
FROM California_table 
ORDER BY Page_Num DESC
LIMIT 1
"""))
  • Alright, a couple of things: (1) you don't have an SQLAlchemy database, that does not exist at all. (2) data to a database is always added "in real time", (3); you want an automated response to a Teams message, how is any database code relevant here? – JarroVGIT Mar 10 '22 at 19:56
  • Hopefully this is simple enough for you to understand: * I have an SQL database * It is streaming data * I want an update on the last data added via a message in teams using a keyword. The SQL call will go into the message... – Brandon Ritchie Mar 10 '22 at 20:28
  • You could consider using a [trigger](https://sqlite.org/lang_createtrigger.html) or an [event](https://docs.sqlalchemy.org/en/14/core/event.html). – snakecharmerb Mar 11 '22 at 07:25

0 Answers0