3 ms·
Noob question but is it possible/advisable to somehow (re)use prepared statements in Lambda? "Prepared statements only last for the duration of the current dat
by zkirill 8y ago
Noob question but is it possible/advisable to somehow (re)use prepared statements in Lambda?
"Prepared statements only last for the duration of the current database session. When the session ends, the prepared statement is forgotten, so it must be recreated before being used again. This also means that a single prepared statement cannot be used by multiple simultaneous database clients..."[1]
1. https://www.postgresql.org/docs/current/sql-prepare.html https://www.postgresql.org/docs/current/sql-prepare.html
- mayank 8y agoStored procedures would be one way.
- laurencerowe 8y agoI don't see why not. Presumably you would connect to the database and prepare the statement when the Lambda function starts up and execute the prepared statement from the per-request handler invoked.