- Fork elmeg-demo codebase for multi-band support - Add data importer infrastructure with base class - Create band-specific importers: - phish.py: Phish.net API v5 - grateful_dead.py: Grateful Stats API - setlistfm.py: Dead & Company, Billy Strings (Setlist.fm) - Add spec-kit configuration for Gemini - Update README with supported bands and architecture
17 lines
557 B
Python
17 lines
557 B
Python
from sqlmodel import SQLModel, create_engine, Session
|
|
import os
|
|
|
|
# Use SQLite for local dev by default, or override with DATABASE_URL env var
|
|
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./database.db")
|
|
|
|
# check_same_thread is needed for SQLite
|
|
connect_args = {"check_same_thread": False} if "sqlite" in DATABASE_URL else {}
|
|
|
|
engine = create_engine(DATABASE_URL, echo=True, connect_args=connect_args)
|
|
|
|
def create_db_and_tables():
|
|
SQLModel.metadata.create_all(engine)
|
|
|
|
def get_session():
|
|
with Session(engine) as session:
|
|
yield session
|