Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pgsqlite/pgsqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ async def sem_task(coro):
return await asyncio.gather(*(sem_task(coro) for coro in coros))

def boolean_transformer(self, val: Any, nullable: bool) -> Union[bool, None]:
if nullable and not val:
if nullable and val is None:
return None
if not nullable and not val:
if not nullable and val is None:
raise Exception("Value is None but column is not nullable")

if val == 1 or val.lower() == "true":
if val == 1 or str(val).lower() == "true":
return "TRUE"
return "FALSE"

Expand Down