Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const {Client} = require('pg')
- const id = '887c141e-7c72-4b73-bd8b-d068c74ca071'
- const client = new Client({
- user: 'postgres',
- host: 'localhost',
- database: 'guttersnipeSimple',
- password: 'postgres',
- port: 5432,
- });
- const shareableQueryFromFile = {
- name: 'fetch-shareable-full',
- text: fs.readFileSync(__dirname + '/../../db/sql/ShareableFullQuery.sql', 'utf8'),
- values: [id]
- }
- client.query(shareableQueryFromFile)
- .then(res => console.log('query resukt', res.rows[0]))
- .catch(e => console.error(e.stack))
Add Comment
Please, Sign In to add comment