exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil, returning: nil) public

Executes insert sql statement in the context of this connection using binds as the bind substitutes. name is logged along with the executed sql statement. Some adapters support the `returning` keyword argument which allows to control the result of the query: `nil` is the default value and maintains default behavior. If an array of column names is passed - the result will contain values of the specified columns from the inserted row.

Show source
Register or log in to add new notes.