Всем привет, не могу подключить postgres к телеграмм боту через tortoise-orm
Использую asyncpg
Код INIT файла:
from tortoise import Tortoise
db = Tortoise()
async def init():
await Tortoise.init(db_url='postgres://postgres:1111@127.0.0.1:5432/xenia_links_bot', modules={'models': ['db.models']})
await Tortoise.generate_schemas()
async def on_shutdown():
await db.close_connections()
КОД MODELS:
from tortoise import fields
class CityIds(Model):
id = fields.IntField(pk=True)
id_ = fields.IntField()
iata = fields.CharField(max_length=25)
name_en = fields.CharField(max_length=1024)
name_ru = fields.CharField(max_length=1024)
country_name_en = fields.CharField(max_length=1024)
country_name_ru = fields.CharField(max_length=1024)
parent_id = fields.IntField()
parent_name_en = fields.CharField(max_length=1024)
parent_name_ru = fields.CharField(max_length=1024)