Add database functions
This commit is contained in:
0
app/pages/__init__.py
Normal file
0
app/pages/__init__.py
Normal file
24
app/pages/costobjects.py
Normal file
24
app/pages/costobjects.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import streamlit as st
|
||||
import pandas as pd
|
||||
from data.scriptloader import get_sql
|
||||
from data.db import get_conn
|
||||
|
||||
|
||||
|
||||
def load_data():
|
||||
sql = get_sql("co_kostenobjekte")
|
||||
print(sql)
|
||||
engine = get_conn("co_dw")
|
||||
with engine.connect() as conn:
|
||||
df = pd.read_sql(sql, engine)
|
||||
print(df)
|
||||
return df
|
||||
|
||||
st.dataframe(load_data())
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
df = load_data()
|
||||
print(df)
|
||||
@@ -1,7 +1,7 @@
|
||||
import streamlit as st
|
||||
from auth_runtime import require_login
|
||||
from ui.sidebar import build_sidebar, hide_sidebar_if_logged_out
|
||||
from auth import get_fullname_for_user, create_user
|
||||
from ui.sidebar import hide_sidebar_if_logged_out
|
||||
from auth import create_user
|
||||
|
||||
hide_sidebar_if_logged_out()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user