luckyframework / luckyframework/avram
`Query#update` doesn't allow *not* updating the `updated_at` field
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Right now, batch `Query#update`, always changes `updated_at`.
I *totally understand* the reason why it was added (#1087 and #1091), but I also think it would be useful to have an option to opt-in / out.
Since at first I thought doing `column: IGNORE` would do something like this (wrong), I was thinking of a solution such as
```crystal
Query.update(column: value, updated_at: UNCHANGED) # so you can specifically opt-out of auto updating
# or something like...
Query.update_only(column: value) # only available on tables that have have the timestamps
```
That would be useful for system-wide tasks / admin stuff and batch updating models with a lot of columns.
I wonder what anyone else thinks of this? Let me know :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Query#update entry point and the timestamp behavior described in issues #1087 and #1091. The issue proposes alternative APIs but does not select one; clarify the intended opt-out behavior, then define tests showing when updated_at changes or remains unchanged. Done means an agreed API and coverage for both update modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal, postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100