這是我的發言: INSERT INTO userpermissions (username, permission)
VALUES ($1, $2),($3,$4)
RETURNING *;
這是我的代碼: db.query(stmt2,values2, (err2, result2) => {
//Do other stuff depending on if there is
我一直在尋找如何使用交易: https://node-postgres.com/features/transactions 但在下面的代碼示例: const { Pool } = require('pg')
const pool = new Pool()
(async() => {
// note: we don't try/catch this because if connec
我想插入一個JSON數組到Postgres中。一切似乎都成功運行(表被創建),但沒有插入數據,也沒有給出錯誤。我正在使用異步/等待方法進行事務處理,但我無法理解失敗的原因。 (async() => {
const client = await pool.connect()
let val= [
{"table_pk":1,"NAME":"my Great Nam