Add database functions

This commit is contained in:
knedlik
2025-12-05 22:52:38 +01:00
parent 3c0e58dfc1
commit 96be7567eb
17 changed files with 111 additions and 15 deletions

0
app/pages/__init__.py Normal file
View File

24
app/pages/costobjects.py Normal file
View 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)

View File

@@ -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()