node.js - Bootstraping an application, is triggers a good idea? -


I am creating an internal web application for components of building parts. I have projects in which some other tables are linked. When a user creates a new project, I want to project "bootstrap" with an original classification schema, which the user can modify for his / her project, so I have to make some copy with a default schema and it will be used by the user project There is a bond in it.

I am running nodes on the backend, as Frontend and Postgres DB on the English JS. Where is the best way to keep this argument? Either I use the trigger on DB. The trigger is activated when a new post is created in the project table. Or, I will do it with complex questions in the node or is there any other way? Is there any best practice? Probably is "easy" to trigger, but I worry about the maintenance and testing of the app.

Since you have a problem with the status of the database, you should resolve it inside the database. Basically there are two ways to solve it:

  1. Enter the project table on the privilege to cancel the new_project () function in which the project contains all the necessary initial conditions for the parameters. Inside that function, you create schemas, copy some, setup privileges and populate the tables with parameter values.
  2. Put on privileged privileges on project tables Create all the required column views from all the relevant tables to create a valid initial project and trigger INSTEAD OF INSERT to see. In the trigger function, you complete all the necessary steps above.

The debugging code on PostgreSQL is not very advanced, but the issue is whether you put the code in PostgreSQL or in the application side, the advantage of PostgreSQL is that the bug - if any - ever It does not take away from where you run the code.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -