Skip to content

EASY: Add property names to the Model object #49

@William-McGonagle

Description

@William-McGonagle

Currently, in the model object schema, there are some properties like hasParameter (function), name (string), and parameters (object). I think it would be cool that in the file where we create the model object, we also add in the columns that the user defined for the model.

You might be wondering what the use case for this would be, but it would be mainly used for what I'm going to show below. Using this below could make the code much more readable and simple to understand, but in the end, User.id would also have the value of "id", so the two would be identical in function.

const userData = User.findOne({
    where: Condition.Equals("id", 1)
})

Turns into

const userData = User.findOne({
    where: Condition.Equals(User.id, 1)
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions