Total.js platform
Total.js platform

JavaScript platform for everyone

Two cases for handling relational data in Total.js

Two cases for handling relational data in Total.js

This blog post describes a relational view for storing data in Total.js framework. Examples support these operations: insert and update. This blog post is not for developers who use NoSQL databases. For testing you have to install PostgreSQL database, if you use macOS just use https://postgresapp.com.

A PostgreSQL database structure for testing

  • create your own testing DB

Workflow: storing data in one method

  • we store all data using the schema.setSave() delegate

Workflow: each schema stores own data

  • each schema stores the data using schema.setSave() delegate
  • we have to add iduser field to each schema
  • this example uses schema.$repository(name, [value]) function as a session store for schemas