Reorder query tuple fields to prevent index drift#127
Conversation
Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
|
@copilot what is the point of this ? also will it break production ? |
Purpose: This change addresses a code maintainability issue without changing functionality. The previous code placed Will it break production? No, this will not break production. The change is purely a reordering of how we destructure the query results - the same data is retrieved and the same variables are used in exactly the same way. The SQL query returns the same data, just in a different order, and the tuple destructuring matches that order. What changed: // Before: (project_id, image_tag, markdown, shell, owner_id, embed_key)
// After: (image_tag, markdown, shell, owner_id, embed_key, project_id)All variables ( |
Addresses feedback from #116: adding
idat the beginning of the query tuple changed all field indices, making the code harder to maintain.Changes:
idfield to end of SELECT query:(image_tag, markdown, shell, owner_id, embed_key, id)instead of(id, image_tag, markdown, shell, owner_id, embed_key)This preserves the original field positions when new fields are added.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.