-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I’m using Toucan2 with MySQL and running insert-returning-instance! to insert a new record while expecting it to return the inserted row. However, instead of getting the full record, the function only returns nil.
Debug Output Shows:
SELECT * FROM table_name WHERE id IN (NULL)
This suggests Toucan2 isn’t correctly capturing the generated ID from the insert.
When testing the same operation in PostgreSQL, the function correctly returns the full inserted row.
Expected Behavior:
- insert-returning-instance! should return the inserted row as a map.
Actual Behavior:
- The function doesn’t return the inserted record.
- Debug logs show that a follow-up SELECT query is being run but incorrectly attempts to fetch the row with WHERE id IN (NULL).
- My primary key (id) is auto-incremented, but Toucan2 isn’t capturing the generated key correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels