AbstractAdapter::executeのコードを読む
公開日:
:
最終更新日:2014/01/31
Ruby on Rails
記事内に広告を含む場合があります。記事内で紹介する商品を購入することで、当サイトに売り上げの一部が還元されることがあります。
% gvim /opt/local/lib/ruby//gems/1.8/gems/activerecord-2.0.2//lib/active_record//connection_adapters/postgresql_adapter.rb
# Executes an SQL statement, returning a PGresult object on success
# or raising a PGError exception otherwise.
def execute(sql, name = nil)
log(sql, name) do
if @async
@connection.async_exec(sql)
else
@connection.exec(sql)
end
end
end
% gvim /opt/local/lib/ruby//gems/1.8/gems/activerecord-2.0.2//lib/active_record//connection_adapters/abstract/database_statements.rb
# Executes the SQL statement in the context of this connection.
def execute(sql, name = nil)
raise NotImplementedError, "execute is an abstract method"
end
関連記事
- PREV
- Railsのマイグレーションにおける文字列型について
- NEXT
- Railsのid生成について調べる