So I've recently starting learning about tortoise-orm. But I have a question: How would I get all the data inside the SQLite database and delete all of them?
Ex Model:
from tortoise.models import Model
from tortoise import fields
class Counter(Model):
count = fields.IntField()
def __str__(self):
return self.name
you can :
Counter.all()
. Awaiting this will give you a python list ofCounter
objects.await Tortoise._drop_database()
BEWARE OF DROPPING THE DATABSE, YOU WILL LOSE ALL YOU DATA