при выполнении функции name, почему то вылазит ошибка: AttributeError: 'NoneType' object has no attribute 'cursor'
из-за чего это?
import nl_international as db_nl_international; from nl_international import Database
import asyncio
async def name_nl_international(name_search):
database = await Database.ConnectDatabase()
result = await asyncio.gather(Database.name(database, name_search))
return result
# -*- coding: utf-8 -*-
import aiosqlite
from sqlite3 import Error
class Database():
async def ConnectDatabase(**kwargs):
try:
db = await aiosqlite.connect('nl_international.db', check_same_thread=False)
c = await db.cursor()
except Error:
print(f'Database: {Error}')
async def name(db, name_search):
c = await db.cursor()
result = await c.execute(f"SELECT * FROM clients WHERE name == '{name_search}'").fetchall()
await db.commit()
return result