Description
Creating a table should stash its settings in self._defaults?
I bodged around this in:
See this snippet of suggestion from Gemini 2.5 Flash: https://gist.github.com/simonw/d867a1791b40b3a5fbfb66b75417c0a3#response-2
But really what should happen is that this code here:
sqlite-utils/sqlite_utils/db.py
Lines 1695 to 1713 in 72f6c82
Should record ALL of the interesting things on self._defaults
.
This matters because if you do table = db.table("name_of_table")
(where that table does not exist yet) and then call table.insert({...}, pk="id", ...)
the table gets created but self._defaults
is not updated, so future methods on that table don't know what the settings are.
This differs from if you do:
table = db.insert({...}, pk="id")
Because in that case the returned table DOES know it settings (I think, maybe because it can introspect them? Not 100% sure.)