Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: EXPOSED-78 Support database-generated values for columns #1844

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

joc-a
Copy link
Collaborator

@joc-a joc-a commented Aug 24, 2023

This feature will enable marking a column as databaseGenerated to be able to omit setting it when inserting a new record without getting an error. The value for the column can be set with TRIGGER or DEFAULT, for example.

@joc-a joc-a force-pushed the joc/support_db_generated_values_for_columns branch 2 times, most recently from 701a012 to 3a4f235 Compare August 25, 2023 12:37
@joc-a joc-a force-pushed the joc/support_db_generated_values_for_columns branch from 3a4f235 to e5d0391 Compare August 30, 2023 13:52
@joc-a joc-a requested a review from e5l August 30, 2023 14:11
@@ -39,6 +39,8 @@ class Column<T>(

fun defaultValueInDb() = dbDefaultValue

internal var isGeneratedInDb: Boolean = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we check what names are used in other frameworks for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what I found:

I didn't find this feature in Ktorm and jOOQ.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

databaseGenerated lgtm

@joc-a joc-a marked this pull request as ready for review September 15, 2023 10:38
@joc-a joc-a requested a review from bog-walk September 15, 2023 10:38
@joc-a joc-a force-pushed the joc/support_db_generated_values_for_columns branch from 7ed4abd to e5d8095 Compare September 18, 2023 10:33
@joc-a joc-a changed the title feat: Support DB-generated values for columns feat: Support database-generated values for columns Sep 18, 2023
@joc-a joc-a changed the title feat: Support database-generated values for columns feat: EXPOSED-78 Support database-generated values for columns Sep 18, 2023
@joc-a joc-a merged commit deff606 into main Sep 18, 2023
3 checks passed
@joc-a joc-a deleted the joc/support_db_generated_values_for_columns branch September 18, 2023 14:30
saral pushed a commit to saral/Exposed that referenced this pull request Oct 3, 2023
…ains#1844)

* feat: EXPOSED-78 Support DB-generated values for columns

This feature will enable marking a column as databaseGenerated to be able to omit setting it when inserting a new record without getting an error. The value for the column can be set by creating a TRIGGER or with a DEFAULT clause, for example.
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.

DAO and DB defaults don't support in batch inserts The default value for a field in an entity
3 participants