method
execute
v7.1.3.2 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements
execute(...)public
Executes an SQL statement, returning a PG::Result object on success or raising a PG::Error exception otherwise.
Setting allow_retry to true causes the db to reconnect and retry executing the SQL statement in case of a connection-related exception. This option should only be enabled for known idempotent queries.
Note: the PG::Result object is manually memory managed; if you don’t need it specifically, you may want consider the exec_query wrapper.