import databases | |
import orm, asyncio | |
# deployment | |
# database = databases.Database( | |
# "postgresql+asyncpg://postgres:[email protected]:5432/postgres" | |
# ) | |
# development | |
# dbLink = "postgresql+asyncpg://postgres:[email protected]:5432/postgres" | |
dbLink = "postgresql+asyncpg://postgres:[email protected]:5432/postgres" | |
database = databases.Database(dbLink) | |
models = orm.ModelRegistry(database=database) | |
class Note(orm.Model): | |
tablename = "notes" | |
registry = models | |
fields = { | |
"id": orm.Integer(primary_key=True), | |
"text": orm.String(max_length=100), | |
"completed": orm.Boolean(default=False), | |
} | |