ru_characters_explorer / database.py
limloop's picture
рейтинговая система
cc146e8
raw
history blame
422 Bytes
import os
import streamlit as st
from supabase import create_client
@st.cache_resource
def init_supabase():
url = os.getenv("SUPABASE_URL")
key = os.getenv("SUPABASE_KEY")
return create_client(url, key)
def get_hash(database, table, hash):
return database.table(table).select("*").eq("hash", hash).execute()
def upsert_data(database, table, data):
return database.table(table).upsert(data).execute()