Add database functions
This commit is contained in:
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)
|
||||
Reference in New Issue
Block a user