Skip to main content

CRUD

Iteria Low-code integrates formik.org and Hasura mutations.

info

We plan tu change tempaltes to support React Hook Forms since they optimize React Rerender.

Soft deleting new(unsaved) records

Iteria Low-code implements logical delete by using isDeleted field in each of the tables. This means we sometimes insert rows that shouldnt really be inserted. Like when the user creates a new record in a array by mistake, then deletes the record. Upon saving we insert a new record with isDeleted set to true in to the DB, this record shouldnt be inserted at all at the first place.

To deal with this problem, we will use the updatedAt field in each record. Upon creating a new record (when we genererate new uuid for a record) we set it to null. Then we can easily identify before sending a mutation which records are new and have isDeleted set to true and filter out these records. Then we can set the updatedAt field either from the mutation response(if its defined there) or generate the timestamp locally.

Handling concurrent updates in DB

info

This feature is not supported yet. This is only a draft for further implementations in the future.

The updatedAt timestamp also can be used to implement a Optimistic lock concurrency control strategy. Here we can use it either in the mutations where condition where: updatedAt=$updatedAt to reduce the affected rows(we only update the records which werent changed in the DB). Or in a event trigger to throw and expection and cancell the mutation execution.