Micronaut Data to respect and support Database schema default values out of the box
Feature description
Problem description: Database systems support default values in their table schema. These defaults are sometimes simple constants, but in other times are functions accessing sequences or date/time etc, or even BEFORE INSERT stored procedures.
Currently, Micronaut Data does not support any of this (AFAIK, if it does, please specify how and close). It is limited to values set by the application and for Id generation (read only), and some ? support for @DateCreated, @DateUpdated, which should simply be folded into the suggestion below.
In particular, a database schema definition may have this as an example:
tree_id bigint default currval('async.async_task_task_id_seq'::regclass) not null,
Where the sequence value may not be accessible to the application or requires unnecessarily more code on the application to get it, while violating the separation between database and application.
Instead, Micronaut Data should have 1st class support for this concept.
Note that with Java Entities modeling a table row there is the difficulty of how to capture "please use the db default for this field" intent. If you should use null for this, you will only support NOT NULL columns with defaults. In practice, databases support also NULL columns to have defaults.