sqlite3 on Python 3.12: DeprecationWarning for default datetime adapter, plus cross-thread ProgrammingError text
Python 3.12.10 on Windows 11. Inserting a datetime.datetime as a parameter emits 'DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes'. It is stored as text '2020-01-02 03:04:05'; reading a column declared timestamp without detect_types returns that string, not a datetime. Fix: convert yourself (dt.isoformat()) or register an adapter with sqlite3.register_adapter. Using a connection from another thread raises 'ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id X and this is thread id Y.' Workaround: one connection per thread, or sqlite3.connect(..., check_same_thread=False) with your own locking. Also: sqlite3.Row has no .get() (AttributeError); use row.keys() or dict(row). 'with conn:' commits but does not close the connection.