from dot_search.store.pg import PgStore
from dot_search.store.protocol import SubSearch
from dot_search.store.sqlite import SQLiteStore


def make_store(db_url: str) -> PgStore | SQLiteStore:
    if db_url.startswith("postgresql"):
        return PgStore(db_url)
    elif db_url.startswith("sqlite"):
        return SQLiteStore(db_url)
    raise ValueError(f"Unsupported db_url scheme: {db_url}")
