django-ai-assistant
django-ai-assistant copied to clipboard
Conditionally bulk_insert Messages
Compatibility with e.g. Mysql, where bulk insert does not return generated primary keys.
Summary by Sourcery
Support databases without bulk insert row-returning capability by falling back to individual saves for message creation.
Bug Fixes:
- Ensure compatibility with DBs (e.g. MySQL) that don’t return generated primary keys from bulk insert.
Enhancements:
- Conditionally use bulk_create when the DB can return inserted rows and otherwise save messages individually to assign IDs correctly.