Model
Models feature helps developers quickly (in minutes) define their model attributes or upload schema data, or paste model attributes then generates model-related CRUD APIs, routes, and more.
Models is an interactive UI with many features & configuration options like Hook setup, indexing, model library, different view settings, and more.
Create or upload schema models
The model framework we support are: sailsjs, totaljs, nestjs, loopbackjs, fastifyjs.
Upload your scheme data for multiple or individual models.
Create new models on DhiWise.
Or simply paste your model attributes (new models > model attributes) to create models.
Pick models from our model library
Inside the library, you will find predefined models and their attributes for you to customize as per your needs to quickly create models.
Configure your model attributes
Attributes Configuration | Description |
---|---|
Attributes | Your model attribute names |
Data types | Select the datatype for your attributes |
Value | Set values to validate your attribute |
Default | Set a default value or have it null |
Private | The attribute will be excluded from the API response |
Require | Set your attribute to be compulsory |
Unique | Set your attribute to be unique |
Auto increment | Set auto increment for you attribute list |
Minimum | Set a minimum length of your attribute |
Maximum | Set a maximum length of your attribute |
Low | Convert attribute to Lowercase |
Trim | Trim excess space |
Pattern | Set a validation pattern for you attributes |
If you have selected the MySQL database, then you can set model relation in "edit relation" with other model attributes from one to many or one to one.
Another feature of schema is you have three different view types to choose from such as code view, tree view, and table view. You can choose anyone between them.
Additionally, simply type in your attribute, and DhiWise will auto-fill the appropriate data type for you.
The data type we have are:
STRING, TEXT, CHAR, BOOL, INTEGER, BIGINT, FLOAT, REAL, DOUBLE, DECIMAL, DATE, DATEONLY, IMESTAMP, UUID, UUIDV4, BLOB, ENUM, JSON, JSONB, ARRAY, GEOMETRY, GEOGRAPHY, RANGE, TINYSTRING, TINYINTEGER, UnsignedBigInt
Insert data type values
String - enum setup > constant selection, & enum attribute.
Array - Add sub-attributes
Relationship - select model
Virtual relationship - Select referred Model and Foreign.
A virtual relationship is a property not stored in MongoDB. Virtuals are typically used for computed properties on documents.
Got a question? Ask here.