Feat: database interactions

This commit is contained in:
2024-12-26 13:39:40 +03:00
parent dae0df1a63
commit 0f058070f2
4 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1 @@
from nwxraybot.models.user import User

19
nwxraybot/models/user.py Normal file
View File

@@ -0,0 +1,19 @@
from peewee import *
from nwxraybot.config import Settings
config = Settings()
db = PostgresqlDatabase(config.postgres_url)
class User(Model):
id = PrimaryKeyField()
name = CharField()
url = CharField()
class Meta:
database = db
User.create_table()