Skip to content

fix: remove empty returning() call on insert statement#42

Draft
hussein-awala wants to merge 1 commit intomainfrom
fix/sqlalchemy-empty-returning
Draft

fix: remove empty returning() call on insert statement#42
hussein-awala wants to merge 1 commit intomainfrom
fix/sqlalchemy-empty-returning

Conversation

@hussein-awala
Copy link
Copy Markdown
Owner

Summary

  • insert(self.model).returning() was called with no arguments when self.returning is None
  • This produces an invalid/unexpected SQLAlchemy statement
  • The returning() clause is correctly applied later only when self.returning is set, but the empty .returning() call on line 46 was always executed for inserts
  • Fix: build insert(self.model) without the empty .returning(), consistent with the update branch

Test plan

  • Existing SQLAlchemy unit tests pass (SQLite)
  • Integration tests with PostgreSQL pass

🤖 Generated with Claude Code

insert(model).returning() was called with no arguments when
self.returning is None. This produces an invalid statement.
The returning() clause should only be added when returning columns
are specified, consistent with the update branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant