sqlite-utils/sqlite_utils
Simon Willison fafa966300 Table.create() now stores configuration in _defaults
When configuration parameters like pk, foreign_keys, not_null, etc.
are passed to Table.create(), they are now stored in self._defaults
so that subsequent operations on the same Table instance (like insert,
upsert) will use those settings automatically.

Previously, calling db["table"].insert({...}, pk="id") would create
the table correctly but subsequent calls to insert() or upsert() on
the same table object would not know about the pk setting, causing
issues like upsert() failing with "requires a pk" error.

Closes #655

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 15:18:55 -08:00
..
__init__.py prepare_connection plugin hook 2023-07-22 15:59:08 -07:00
__main__.py Support 'python -m sqlite_utils', closes #368 2022-01-08 18:33:22 -08:00
cli.py Ran black 2025-11-23 11:59:19 -08:00
db.py Table.create() now stores configuration in _defaults 2025-11-23 15:18:55 -08:00
hookspecs.py prepare_connection plugin hook 2023-07-22 15:59:08 -07:00
plugins.py More robust _called_from_test pattern 2023-07-22 16:21:27 -07:00
py.typed py.typed file so mypy picks up the types, closes #331 2021-11-14 15:21:04 -08:00
recipes.py errors=r.SET_NULL/r.IGNORE options for parsedate/parsedatetime, closes #416 2022-03-20 21:01:35 -07:00
utils.py More consistent indentation 2024-01-14 09:27:58 -08:00