pvanand commited on
Commit
1e97c1e
·
verified ·
1 Parent(s): 131998f

Update rag_routerv2.py

Browse files
Files changed (1) hide show
  1. rag_routerv2.py +3 -2
rag_routerv2.py CHANGED
@@ -46,7 +46,8 @@ def init_db():
46
  id INTEGER PRIMARY KEY,
47
  user_id TEXT NOT NULL,
48
  table_id TEXT NOT NULL,
49
- table_name TEXT NOT NULL
 
50
  )
51
  ''')
52
  db.execute('''
@@ -171,7 +172,7 @@ async def query_table(
171
  async def get_tables(user_id: str):
172
  db = get_db()
173
  tables = db.execute('''
174
- SELECT t.*, GROUP_CONCAT(tf.filename) as filenames, GROUP_CONCAT(tf.file_path) as file_paths
175
  FROM tables t
176
  LEFT JOIN table_files tf ON t.table_id = tf.table_id
177
  WHERE t.user_id = ?
 
46
  id INTEGER PRIMARY KEY,
47
  user_id TEXT NOT NULL,
48
  table_id TEXT NOT NULL,
49
+ table_name TEXT NOT NULL,
50
+ created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
51
  )
52
  ''')
53
  db.execute('''
 
172
  async def get_tables(user_id: str):
173
  db = get_db()
174
  tables = db.execute('''
175
+ SELECT t.*, t.created_time, GROUP_CONCAT(tf.filename) as filenames, GROUP_CONCAT(tf.file_path) as file_paths
176
  FROM tables t
177
  LEFT JOIN table_files tf ON t.table_id = tf.table_id
178
  WHERE t.user_id = ?