Feat: database interactions
This commit is contained in:
1
nwxraybot/models/__init__.py
Normal file
1
nwxraybot/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from nwxraybot.models.user import User
|
||||
19
nwxraybot/models/user.py
Normal file
19
nwxraybot/models/user.py
Normal 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()
|
||||
Reference in New Issue
Block a user