Methods
- B
- C
- E
Constants
MONEY_COLUMN_TYPE_OID | = | 790 |
The internal PostgreSQL identifier of the money data type. |
||
BYTEA_COLUMN_TYPE_OID | = | 17 |
The internal PostgreSQL identifier of the BYTEA data type. |
Instance Public methods
begin_db_transaction()
Link
Begins a transaction.
begin_isolated_db_transaction(isolation)
Link
commit_db_transaction()
Link
Commits a transaction.
exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil)
Link
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 111 def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) if use_insert_returning? || pk == false super else result = exec_query(sql, name, binds) unless sequence_name table_ref = extract_table_ref_from_insert_sql(sql) if table_ref pk = primary_key(table_ref) if pk.nil? pk = suppress_composite_primary_key(pk) sequence_name = default_sequence_name(table_ref, pk) end return result unless sequence_name end last_insert_id_result(sequence_name) end end
exec_query(sql, name = "SQL", binds = [], prepare: false)
Link
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 78 def exec_query(sql, name = "SQL", binds = [], prepare: false) execute_and_clear(sql, name, binds, prepare: prepare) do |result| types = {} fields = result.fields fields.each_with_index do |fname, i| ftype = result.ftype i fmod = result.fmod i types[fname] = get_oid_type(ftype, fmod, fname) end ActiveRecord::Result.new(fields, result.values, types) end end
exec_rollback_db_transaction()
Link
Aborts a transaction.
execute(sql, name = nil)
Link
Executes an SQL statement, returning a PG::Result object on success or
raising a PG::Error exception otherwise. Note: the PG::Result object is
manually memory managed; if you don't need it specifically, you may
want consider the exec_query
wrapper.
explain(arel, binds = [])
Link