waelstaha commited on
Commit
c2b5841
·
1 Parent(s): 8b46060

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -20,7 +20,8 @@ if JSON_DATA_LABEL not in st.session_state:
20
  st.session_state[JSON_DATA_LABEL] = {}
21
 
22
  def tables_from_db():
23
- db = sqlite3.connect('switrs.sqlite')
 
24
  cursor = db.cursor()
25
  cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
26
  tables = cursor.fetchall()
@@ -29,7 +30,8 @@ def tables_from_db():
29
  return tables
30
 
31
  def from_db(table: str):
32
- db = sqlite3.connect('switrs.sqlite')
 
33
  # Read into a panda DataFrame
34
  df = pd.read_sql_query(f"SELECT * FROM {table} LIMIT 50", db)
35
  db.close()
@@ -43,7 +45,8 @@ def from_db(table: str):
43
 
44
 
45
  def get_sql_agent():
46
- db = SQLDatabase.from_uri("sqlite:///switrs.sqlite")
 
47
 
48
  toolkit = SQLDatabaseToolkit(llm=llm,db=db)
49
 
 
20
  st.session_state[JSON_DATA_LABEL] = {}
21
 
22
  def tables_from_db():
23
+ # db = sqlite3.connect('switrs.sqlite')
24
+ db = sqlite3.connect('FXTrades.db')
25
  cursor = db.cursor()
26
  cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
27
  tables = cursor.fetchall()
 
30
  return tables
31
 
32
  def from_db(table: str):
33
+ # db = sqlite3.connect('switrs.sqlite')
34
+ db = sqlite3.connect('FXTrades.db')
35
  # Read into a panda DataFrame
36
  df = pd.read_sql_query(f"SELECT * FROM {table} LIMIT 50", db)
37
  db.close()
 
45
 
46
 
47
  def get_sql_agent():
48
+ # db = SQLDatabase.from_uri("sqlite:///switrs.sqlite")
49
+ db = SQLDatabase.from_uri("sqlite:///FXTrades.db")
50
 
51
  toolkit = SQLDatabaseToolkit(llm=llm,db=db)
52