support dynamic insert
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 267
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 5
Description
hi, bob:
When calling db.save(obj) for insert operations, it would be helpful if the insert statement were dynamically generated based on the non-null properties of obj, rather than using a predefined insert statement with all the fields included.
I understand this might impact performance slightly; however, this approach would leverage database-default-column-values effectively. If some columns are omitted from the insert statement, the database could automatically assign default values defined for those columns.
For reference, Hibernate provides a similar feature through the @DynamicInsert annotation. See: https://docs.jboss.org/hibernate/orm/6.5/javadocs/org/hibernate/annotations/DynamicInsert.html
Alternatively, if complete SQL insert statements are preferred, the framework could explicitly include the DEFAULT keyword for such columns in the dynamically generated SQL statements.
Contributor guide
No contributing guide indexed for this repository
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 at the db.save(obj) insert path and inspect how predefined insert statements are generated. Done means inserts can omit null properties so database defaults apply, with the preferred handling of omitted columns or the DEFAULT keyword decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100