Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ from streamlit_extras.stylable_container import stylable_container
|
|
21 |
from streamlit_extras.stateful_button import button
|
22 |
import json
|
23 |
from io import BytesIO
|
24 |
-
import
|
25 |
# ######
|
26 |
# import os
|
27 |
# import subprocess
|
@@ -167,12 +167,10 @@ with selectcol12:
|
|
167 |
if select1 =='DB_10001' and select2 is not None:
|
168 |
with st.spinner("Loading Tables:"):
|
169 |
|
170 |
-
|
171 |
"Database=sqldb-ext-dev-uks-001;"
|
172 |
"UID=dbadmin;"
|
173 |
"PWD=mYpa$$w0rD" )
|
174 |
-
# Establish connection
|
175 |
-
conn1 = msdp.connect(conn1_str)
|
176 |
|
177 |
query0_1=f"select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='{select2}' ORDER BY TABLE_NAME ASC"
|
178 |
st.session_state.tab_names_init=list(pd.read_sql_query(query0_1,con=conn1)['TABLE_NAME'])
|
@@ -229,13 +227,12 @@ if select1 =='DB_10001' and select2 is not None:
|
|
229 |
with st.container(height= 400, border=True):
|
230 |
cole1,cole2=st.columns([1,1.5])
|
231 |
with cole1:
|
232 |
-
|
233 |
"Server=sql-ext-dev-uks-001.database.windows.net;"
|
234 |
"Database=sqldb-ext-dev-uks-001;"
|
235 |
"UID=dbadmin;"
|
236 |
"PWD=mYpa$$w0rD" )
|
237 |
-
|
238 |
-
conn = msdp.connect(conn_str)
|
239 |
table_selector= tab_names_shown[i]
|
240 |
if table_selector is not None:
|
241 |
query2="select "+count+" * from [dbo].["+table_selector+"]"
|
|
|
21 |
from streamlit_extras.stateful_button import button
|
22 |
import json
|
23 |
from io import BytesIO
|
24 |
+
import pymssql
|
25 |
# ######
|
26 |
# import os
|
27 |
# import subprocess
|
|
|
167 |
if select1 =='DB_10001' and select2 is not None:
|
168 |
with st.spinner("Loading Tables:"):
|
169 |
|
170 |
+
conn1 = pymssql.connect("Server=sql-ext-dev-uks-001.database.windows.net;"
|
171 |
"Database=sqldb-ext-dev-uks-001;"
|
172 |
"UID=dbadmin;"
|
173 |
"PWD=mYpa$$w0rD" )
|
|
|
|
|
174 |
|
175 |
query0_1=f"select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='{select2}' ORDER BY TABLE_NAME ASC"
|
176 |
st.session_state.tab_names_init=list(pd.read_sql_query(query0_1,con=conn1)['TABLE_NAME'])
|
|
|
227 |
with st.container(height= 400, border=True):
|
228 |
cole1,cole2=st.columns([1,1.5])
|
229 |
with cole1:
|
230 |
+
conn = pymssql.connect("Driver={ODBC Driver 17 for SQL Server};"
|
231 |
"Server=sql-ext-dev-uks-001.database.windows.net;"
|
232 |
"Database=sqldb-ext-dev-uks-001;"
|
233 |
"UID=dbadmin;"
|
234 |
"PWD=mYpa$$w0rD" )
|
235 |
+
|
|
|
236 |
table_selector= tab_names_shown[i]
|
237 |
if table_selector is not None:
|
238 |
query2="select "+count+" * from [dbo].["+table_selector+"]"
|