-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Based on https://node-postgres.com
There are a few different approaches to consider:
Copy streams: https://github.com/brianc/node-pg-copy-streams
Multiple executes:
CREATE TABLE person (
id SERIAL PRIMARY KEY,
name TEXT,
age INTEGER
);
--
PREPARE insert_person_plan (text, integer) AS
INSERT INTO person (name, age)
VALUES ($1, $2);
BEGIN;
EXECUTE insert_person_plan('Alice', 25);
EXECUTE insert_person_plan('Bob', 30);
EXECUTE insert_person_plan('Charlie', 35);
COMMIT;
{
"execute": {
"insert_person_plan": [
["Alice", 25],
["Bob", 30],
["Charlie", 35],
]
}
}
--
DEALLOCATE insert_person_plan;
SELECT * FROM person;
DROP TABLE person;
skarpovru
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed