porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.09k stars 259 forks source link

insert table not work #775

Closed lonelysnows closed 6 months ago

lonelysnows commented 6 months ago

async function addUser(){ const users = [{ name: 'Murray', age: 68, }, { name: 'Walter', age: 80 }] console.log('in') let res=await sqlinsert into users ${ sql(users) }.describe(); console.log(res); return 'add success' }

outcome: { string: "insert into users (\"name\",\"age\")values($1,$2),($3,$4)", types: [ 1043, 20, 1043, 20 ], name: "ykl9i57au42", columns: [], } but the table don't add two rows

Louis-Tian commented 6 months ago

remove the describe() at the end your statement.