https://medium.com/@dfrase/what-are-encryption-keys-and-how-do-they-work-cc48c3053bd6
The full context of the code shown here can be viewed here
|-- package.json
|-- docker-compose.yml
|-- config.js
|-- table_tennis.sql
|-- zseeds.sql
The full context of the code shown here can be viewed here
|-- client
|-- package.json
|-- postcss.config.js
|-- webpack.config.js
The full context of the code shown here can be viewed here
|-- package.json
|-- config.js
|-- db
|-- pgHelper.js
|-- dbQueryHelper.js
be aware that MySQL, SQL-Server, and SQLite all use different syntax, this is ONLY for PostgreSQL.
Why would you want to create a UDF that links to a Trigger? A trigger allows something to happen automatically, meaning once you have set it up you don't have to think about it again. The following example allows uses a 'games' table that takes p1_id, p2_id, p1_score, and p2_score. It has a winner_id column. This column could be populated via outside logic, but why should it be? It would be simpler, and avoid accidental error if the structure of the outside logic changed, if it was populated using an internal function, that happens whenever a new row is inserted.
The top of the .sql file looks like this:
DROP TABLE IF EXISTS games CASCADE;