Ruby-Cogs/appeals/db/__init__.py
Valerie 477974d53c
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
Upload 2 Cogs & Update README
2025-05-23 01:30:53 -04:00

15 lines
397 B
Python

import sqlite3
from piccolo.engine import sqlite
### MONKEYPATCHING ###
# This is a workaround for a bug in Piccolo's SQLite engine where it doesn't handle integers correctly.
@sqlite.decode_to_string
def convert_int_out(value: str) -> int:
return int(value)
sqlite.CONVERTERS["INTEGER"] = convert_int_out
sqlite3.register_converter("INTEGER", convert_int_out)
### END MONKEYPATCHING ###