So here's the problem, you're working in a file, let's say:
├── my-project
│ └── src
│ ├── cool-module
│ │ └── index.js
│ └── lib
│ ├── helpers.js
│ └── super-lib
So here's the problem, you're working in a file, let's say:
├── my-project
│ └── src
│ ├── cool-module
│ │ └── index.js
│ └── lib
│ ├── helpers.js
│ └── super-lib
| import Head from 'next/head' | |
| import { Container } from 'reactstrap' | |
| const Layout = (props) => ( | |
| <div> | |
| <Head> | |
| <title>PairHub</title> | |
| <meta name="viewport" content="initial-scale=1.0, width=device-width" /> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" /> | |
| </Head> |
| CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$ | |
| DECLARE | |
| channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes'); | |
| BEGIN | |
| IF TG_OP = 'INSERT' THEN | |
| PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}'); | |
| RETURN NEW; | |
| END IF; | |
| IF TG_OP = 'DELETE' THEN | |
| PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}'); |