≡ModelConfig - DbModelWriteCall
Write an entry in database by creating a insert or update sql from entry in sourcePath.
The object must be an instance of @ModelConfigDbObject.
Github
Super Class
≡DbModelCall
Interface
≡ConfigWriteCommand
Write Example
With
≡DbModelWriteCall
one has the possibility to write entries in the database
on the server side depending on the object parameters defined in
≡sourcePath
.
In the example the
≡sourcePath
"abc" contains an
≡AnObject
object with
≡id
"3".
≡DbModelWriteCall
will update the third entry of the preloaded
DbSqlConfig.json#L43.
The updated entry will be returned on
≡targetPath
"xyz".
The examples would not work
since
the role guest has not the permission
to insert or update. Only
≡DbModelReadCall
is allowed.
The configuration of
≡AnObject
is a special extension of
≡ModelConfigObject
. Any
object with a configuration of type
≡DbModelConfig
could be used for a generic
≡DbModelCall
This allows to define properties like
≡table
with
≡DbModelConfig
With the implementation of
≡PermissionConfig
the model configuration has some role access restrictions.
≡AnObject
shows that there is a only read property defined for "guest".
How it works
The configuration of
≡AnObject
is a special extension of
≡ModelConfigObject
. Any
object with a configuration of type
≡DbModelConfig
could be used for a generic
≡DbModelCall
This allows to define properties like
≡table
with
≡DbModelConfig
With the implementation of
≡PermissionConfig
the model configuration has some role access restrictions.
It's a nice example to show the potential of the typed JSON concept. From a client perspective a generic
database query is straight forward setting a database object.
And from the server side one just has to change the type of the
ModelConfig.json
to allow
CRUD database requests.
Fields
Configuration