import logging
from datetime import datetime
from typing import List

from sqlmodel import Session, select

from db import engine
from models import Social, User


def get_last_social() -> Social:
    with Session(engine) as session:
        statement = select(Social).order_by(Social.id.desc()).limit(1)
        result = session.exec(statement).one_or_none()
    logging.info(f"SELECT social row: {result}")
    return result


def get_previous_social() -> Social:
    with 