"""
Compatibility wrapper: Provides MongoDB-like interface using SQLite backend.

All imports from `common.mongo_client` now use SQLite instead of MongoDB.
This file re-exports from `common.mongodb` which wraps `common.sqlite_client`.
"""

# Re-export everything from the new MongoDB-compatible wrapper
from common.mongodb import (
    mongodb_client,
    generate_uid,
    utc_now,
    serialize_row as serialize_doc,
    parse_time,
    format_time,
    init_mongodb,
    close_mongodb,
    # Collection constants (use COLLECTION_* names)
    COLLECTION_USERS,
    COLLECTION_MEMOS,
    COLLECTION_ATTACHMENTS,
    COLLECTION_MEMO_RELATIONS,
    COLLECTION_REACTIONS,
    COLLECTION_MEMO_EMBEDDINGS,
    COLLECTION_INBOX,
    COLLECTION_USER_SETTINGS,
    COLLECTION_SHORTCUTS,
    COLLECTION_TEAMS,
    COLLECTION_TEAM_MEMBERS,
    COLLECTION_TEAM_MEMOS,
    COLLECTION_TEAM_COMMENTS,
    COLLECTION_TEAM_REACTIONS,
    COLLECTION_USER_PROFILES,
    COLLECTION_REFRESH_TOKENS,
)

# For backward compatibility - some code might import these
COLLECTION_MEMOS = COLLECTION_MEMOS
COLLECTION_ATTACHMENTS = COLLECTION_ATTACHMENTS
COLLECTION_MEMO_RELATIONS = COLLECTION_MEMO_RELATIONS
COLLECTION_REACTIONS = COLLECTION_REACTIONS
COLLECTION_MEMO_EMBEDDINGS = COLLECTION_MEMO_EMBEDDINGS
COLLECTION_INBOX = COLLECTION_INBOX
COLLECTION_USER_SETTINGS = COLLECTION_USER_SETTINGS
COLLECTION_SHORTCUTS = COLLECTION_SHORTCUTS
COLLECTION_TEAMS = COLLECTION_TEAMS
COLLECTION_TEAM_MEMBERS = COLLECTION_TEAM_MEMBERS
COLLECTION_TEAM_MEMOS = COLLECTION_TEAM_MEMOS
COLLECTION_TEAM_COMMENTS = COLLECTION_TEAM_COMMENTS
COLLECTION_TEAM_REACTIONS = COLLECTION_TEAM_REACTIONS
COLLECTION_USER_PROFILES = COLLECTION_USER_PROFILES
COLLECTION_USERS = COLLECTION_USERS
COLLECTION_REFRESH_TOKENS = COLLECTION_REFRESH_TOKENS

__all__ = [
    "mongodb_client",
    "generate_uid",
    "utc_now",
    "serialize_doc",
    "parse_time",
    "format_time",
    "init_mongodb",
    "close_mongodb",
    "COLLECTION_MEMOS",
    "COLLECTION_ATTACHMENTS",
    "COLLECTION_MEMO_RELATIONS",
    "COLLECTION_REACTIONS",
    "COLLECTION_MEMO_EMBEDDINGS",
    "COLLECTION_INBOX",
    "COLLECTION_USER_SETTINGS",
    "COLLECTION_SHORTCUTS",
    "COLLECTION_TEAMS",
    "COLLECTION_TEAM_MEMBERS",
    "COLLECTION_TEAM_MEMOS",
    "COLLECTION_TEAM_COMMENTS",
    "COLLECTION_TEAM_REACTIONS",
    "COLLECTION_USER_PROFILES",
    "COLLECTION_USERS",
    "COLLECTION_REFRESH_TOKENS",
]
