Add tests and fix issues
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
from os import getenv
|
||||
|
||||
import streamlit as st
|
||||
from sqlalchemy.sql import text
|
||||
from streamlit.connections import BaseConnection
|
||||
|
||||
connection: BaseConnection = st.connection("sqlite")
|
||||
def connection() -> BaseConnection:
|
||||
_connection = st.connection("sql", url=getenv('DATABASE_URL'))
|
||||
with _connection.session as configured_session:
|
||||
configured_session.execute(text('PRAGMA foreign_keys=ON'))
|
||||
return _connection
|
||||
|
||||
|
||||
with connection.session as configure_session:
|
||||
configure_session.execute(text('PRAGMA foreign_keys=ON'))
|
||||
Reference in New Issue
Block a user