import peewee
from peewee import *
db = SqliteDatabase('data.db')
class User(Model):
class Meta:
database = db
db_table = 'Users'
vk_id = IntegerField()
warns = IntegerField()
if __name__ == '__main__':
db.create_tables([User])
user = await bot.api.users.get(message.from_id)
from peewee import *
db = SqliteDatabase('people.db')
class Person(Model):
name = CharField()
birthday = DateField()
class Meta:
database = db # This model uses the "people.db" database.
db.connect()
db.create_tables([Person])
from datetime import date
uncle_bob = Person(name='Bob', birthday=date(1960, 1, 15))
uncle_bob.save() # bob is now stored in the database