import horsql
import pandas as pd
import datetime
from horsql.operators import And, Like, Or

db = horsql.connect("rps", "localhost", 5432, "dev", "dev", echo=True)


users = [
    dict(user_id=4, email="asda11", birthday=None),
    dict(user_id=2, email="asda22", birthday=None),
    dict(user_id=3, email="asda22", birthday="2023-09-19"),
]

df = pd.DataFrame(users)


db.public.users.update(
    df, conflict_columns=["user_id"], update_columns=["birthday", "email"]
)


db.public.users.get(
    count=["user_id", "user_name"],
    where=Or(user_id=2, _=And(user_id=4, email=Like("%@%"))),
)
