const query = {
text: 'INSERT INTO users(name, email) VALUES($1, $2)',
values: ['brianc', 'brian.m.carlson@gmail.com'],
}
const res = await client.query(query)
console.log(res.rows[0])
"number"
. Но может да и ты прав хз. const query = {
`text: SELECT pr.printer_id, m.material
FROM printer_material pm
JOIN printer pr ON pm.printer_id = pr.printer_id
JOIN material m ON pm.material_id = m.material_id
WHERE pr.printer_id = $1,
values: [printer_id],`
};
error: ошибка синтаксиса (примерное положение: "[")
at Parser.parseErrorMessage (/var/www/html/test_aria/api/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/var/www/html/test_aria/api/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/var/www/html/test_aria/api/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/var/www/html/test_aria/api/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
length: 149,
severity: 'ОШИБКА',
code: '42601',
detail: undefined,
hint: undefined,
position: '188',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1188',
routine: 'scanner_yyerror'
}
и получил и это сдец