mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-18 16:11:45 +03:00
19 lines
467 B
Python
19 lines
467 B
Python
from logger import get_logger
|
|
from models.settings import CommonsDep
|
|
from models.users import User
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
def create_user(commons: CommonsDep, user: User, date):
|
|
logger.info(f"New user entry in db document for user {user.email}")
|
|
|
|
return (
|
|
commons["supabase"]
|
|
.table("users")
|
|
.insert(
|
|
{"user_id": user.id, "email": user.email, "date": date, "requests_count": 1}
|
|
)
|
|
.execute()
|
|
)
|