Skip to content

Commit

Permalink
Make delete awaitable
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Oct 11, 2024
1 parent e356387 commit 43d8681
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions genotype_api/database/crud/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
class DeleteHandler(BaseHandler):

async def delete_analysis(self, analysis: Analysis) -> None:
self.session.delete(analysis)
await self.session.delete(analysis)
await self.session.commit()

async def delete_plate(self, plate: Plate) -> None:
self.session.delete(plate)
await self.session.delete(plate)
await self.session.commit()

async def delete_sample(self, sample: Sample) -> None:
self.session.delete(sample)
await self.session.delete(sample)
await self.session.commit()

async def delete_user(self, user: User) -> None:
self.session.delete(user)
await self.session.delete(user)
await self.session.commit()

async def delete_snps(self) -> int:
query = select(SNP)
snps: list[SNP] = await self.fetch_all_rows(query)
count: int = len(snps)
for snp in snps:
self.session.delete(snp)
await self.session.delete(snp)
await self.session.commit()
return count

0 comments on commit 43d8681

Please sign in to comment.