django-ai-assistant icon indicating copy to clipboard operation
django-ai-assistant copied to clipboard

Conditionally bulk_insert Messages

Open an7oine opened this issue 3 weeks ago • 4 comments

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.

an7oine avatar Nov 19 '25 08:11 an7oine