A single row can be inserted like this:
client.query("insert into tableName (name, email) values ($1, $2) ", ['john', '[email protected]'], callBack)
This approach automatically comments out any special characters.
How do i insert multiple rows at once?
I need to implement this:
"insert into tableName (name, email) values ('john', '[email protected]'), ('jane', '[email protected]')"
I can just use js string operators to compile such rows manually, but then i need to add special characters escape somehow.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…