BatchExecuteStatement
Source:
src/AWS/RDSData/BatchExecuteStatement.ts
Runtime binding for rds-data:BatchExecuteStatement — run one SQL
statement over many parameter sets in a single Data API call (bulk
insert/update/delete).
Bind it to a Data-API-enabled DBCluster and its credentials secret,
exactly like AWS.RDSData.ExecuteStatement; provide the implementation
with Effect.provide(AWS.RDSData.BatchExecuteStatementHttp).
Batch Writes
Section titled “Batch Writes”// init — bind alongside your other Data API operationsconst batchExecuteStatement = yield* AWS.RDSData.BatchExecuteStatement( db.cluster, { secret: db.secret, database: "app" },);
// runtime — one statement, one parameter set per rowconst result = yield* batchExecuteStatement({ sql: "INSERT INTO todos (id, title) VALUES (:id, :title)", parameterSets: rows.map((row) => [ { name: "id", value: { longValue: row.id } }, { name: "title", value: { stringValue: row.title } }, ]),});