This commit is contained in:
dni ⚡
2024-10-10 09:07:34 +02:00
parent 219e8746c5
commit cae81b61a3
+4 -6
View File
@@ -159,16 +159,14 @@ class Connection(Compat):
return row return row
async def update(self, table_name: str, model: BaseModel, where: str = "id = :id"): async def update(self, table_name: str, model: BaseModel, where: str = "id = :id"):
result = await self.conn.execute( await self.conn.execute(
text(update_query(table_name, model, where)), model.dict() text(update_query(table_name, model, where)), model.dict()
) )
result.close() await self.conn.commit()
async def insert(self, table_name: str, model: BaseModel): async def insert(self, table_name: str, model: BaseModel):
result = await self.conn.execute( await self.conn.execute(text(insert_query(table_name, model)), model.dict())
text(insert_query(table_name, model)), model.dict() await self.conn.commit()
)
result.close()
async def fetch_page( async def fetch_page(
self, self,