pyrqlite
pyrqlite copied to clipboard
rqlite does not like empty DATETIME columns
I get the following error unless I set defaults in datetime columns:
venv/lib/python3.8/site-packages/pyrqlite/extensions.py", line 111, in <lambda> 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z')
I commented wrong version - I am using sqlalchemy. Sorry.
I was facing similar issue, I have updated venv/lib/python3.8/site-packages/pyrqlite/extensions.py:
Line 111 (https://github.com/rqlite/pyrqlite/blob/master/src/pyrqlite/extensions.py#L111): Replaced: 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z') With: 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z') if x is not None else None,
Then it supported empty Datetime for me.
Fixed by https://github.com/rqlite/pyrqlite/pull/62 and released in v2.2.3 (24d91e025f25efd1fe89215647eb2cc882c1802a).
Thanks @zmedico