Update app.py
Browse files
app.py
CHANGED
|
@@ -51,6 +51,15 @@ def read_sql_query(sql,db):
|
|
| 51 |
return rows
|
| 52 |
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
#save uploaded file
|
| 55 |
def save_uploaded_file(uploaded_file):
|
| 56 |
file_path = os.path.join(os.getcwd(), "uploaded.db")
|
|
@@ -68,16 +77,6 @@ if uploaded_file is not None:
|
|
| 68 |
st.sidebar.success("Database uploaded successfully.")
|
| 69 |
|
| 70 |
|
| 71 |
-
|
| 72 |
-
st.set_page_config("DataChat: Explore Your Database")
|
| 73 |
-
st.header("chat with your sql database")
|
| 74 |
-
|
| 75 |
-
table_name = st.text_input("Enter the correct table name")
|
| 76 |
-
|
| 77 |
-
question=st.text_input("enter your input/question")
|
| 78 |
-
|
| 79 |
-
input=f"{question} in {table_name} table"
|
| 80 |
-
|
| 81 |
submit=st.button("submit")
|
| 82 |
|
| 83 |
|
|
|
|
| 51 |
return rows
|
| 52 |
|
| 53 |
|
| 54 |
+
st.set_page_config("DataChat: Explore Your Database")
|
| 55 |
+
st.header("DataChat: Chat With SQL Database")
|
| 56 |
+
|
| 57 |
+
table_name = st.text_input("Enter the correct table name")
|
| 58 |
+
|
| 59 |
+
question=st.text_input("enter your input/question")
|
| 60 |
+
|
| 61 |
+
input=f"{question} in {table_name} table"
|
| 62 |
+
|
| 63 |
#save uploaded file
|
| 64 |
def save_uploaded_file(uploaded_file):
|
| 65 |
file_path = os.path.join(os.getcwd(), "uploaded.db")
|
|
|
|
| 77 |
st.sidebar.success("Database uploaded successfully.")
|
| 78 |
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
submit=st.button("submit")
|
| 81 |
|
| 82 |
|