Module | Sequel::MySQL::PreparedStatements::DatasetMethods |
In: |
lib/sequel/adapters/shared/mysql_prepared_statements.rb
|
MySQL is different in that it supports prepared statements but not bound variables outside of prepared statements. The default implementation breaks the use of subselects in prepared statements, so extend the temporary prepared statement that this creates with a module that fixes it.
# File lib/sequel/adapters/shared/mysql_prepared_statements.rb, line 155 155: def call(type, bind_arguments={}, *values, &block) 156: ps = to_prepared_statement(type, values) 157: ps.extend(CallableStatementMethods) 158: ps.call(bind_arguments, &block) 159: end
Store the given type of prepared statement in the associated database with the given name.
# File lib/sequel/adapters/shared/mysql_prepared_statements.rb, line 163 163: def prepare(type, name=nil, *values) 164: ps = to_prepared_statement(type, values) 165: ps.extend(PreparedStatementMethods) 166: if name 167: ps.prepared_statement_name = name 168: db.set_prepared_statement(name, ps) 169: end 170: ps 171: end