norm icon indicating copy to clipboard operation
norm copied to clipboard

Norm should Generate Params as Non Nullable for Non Nullable DB Fields

Open vitulrana opened this issue 4 years ago • 0 comments

Hi Team,

There is a small Issue with NORM Generated Files for UPDATE, INSERT and DELETE Queries. For the Params, it does not consider the Non-Nullability of Database Column rather it always Generate it as Nullable.

For Example -

If a query is INSERT INTO users (first_name, last_name) VALUES (:firstName, :lastName);

Generated Data Class would be like this

data class CreateUserParams(
  val firstName: String?,
  val lastName: String?,
)

But, Ideally it should be like this because in Database first_name and last_name are Non Nullable.

data class CreateUserParams(
  val firstName: String,
  val lastName: String,
)

vitulrana avatar Oct 16 '20 05:10 vitulrana