Skip to content

Commit

Permalink
Continue to use the bind parameter syntax even on non prepared statem…
Browse files Browse the repository at this point in the history
…ents

Appears to effectively revert rails#8966
He was using the non prepared statement so that .to_sql would return
sql with parameters already bound, although this doesn't relate
to whether we are using prepared statements or not.
Also related rails@fd398475
  • Loading branch information
kacasey8 committed Mar 25, 2014
1 parent f72058a commit 1722559
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -847,8 +847,15 @@ def initialize_type_map(type_map)

FEATURE_NOT_SUPPORTED = "0A000" #:nodoc:

def unprepared_visitor
Arel::Visitors::PostgreSQL.new self
end

def exec_no_cache(sql, name, binds)
log(sql, name, binds) { @connection.async_exec(sql) }
type_casted_binds = binds.map { |col, val|
[col, type_cast(val, col)]
}
log(sql, name, binds) { @connection.async_exec(sql, type_casted_binds.map { |_, val| val }) }
end

def exec_cache(sql, name, binds)
Expand Down

1 comment on commit 1722559

@matthewd
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tenderlove looks like we need to chat some more about this. I'll try to catch you in the morning.

Please sign in to comment.