sqlalchemy-rqlite icon indicating copy to clipboard operation
sqlalchemy-rqlite copied to clipboard

Error if datetime columns are empty/null

Open MRB60 opened this issue 1 year ago • 3 comments

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')

Defaults must be set.

MRB60 avatar Mar 21 '23 14:03 MRB60

I do not know the source of the error, but you shoudl set explicit date and timestamps in any event when using rqlite. Non-deterministic functions in SQLite are not currrently supported -- see https://rqlite.io/docs/api/non-deterministic/

otoolep avatar Mar 28 '23 13:03 otoolep

Any comment @zmedico ?

otoolep avatar Mar 28 '23 13:03 otoolep

Sqlite3 itself accepts empty/null/None Datetime columns. Problem occured when I switched from Sqlite3 to Rqlite. However, it was easy fixed by setting default timestamp for column.

MRB60 avatar Mar 29 '23 08:03 MRB60

Please test with pyrqlite 2.2.3 which has the fix from https://github.com/rqlite/pyrqlite/pull/62.

zmedico avatar Jun 07 '24 03:06 zmedico

Please reopen if you think this is not the same as https://github.com/rqlite/pyrqlite/issues/51 fixed by https://github.com/rqlite/pyrqlite/pull/62.

zmedico avatar Jun 07 '24 04:06 zmedico