def execute_batch( sql, bind_vars = [], *args )
unless [Array, Hash].include?(bind_vars.class)
bind_vars = [bind_vars]
warn("\#{caller[0]} is calling SQLite3::Database#execute_batch with bind parameters\nthat are not a list of a hash. Please switch to passing bind parameters as an\narray or hash. Support for this behavior will be removed in version 2.0.0.\n") if $VERBOSE
end
if bind_vars.nil? || !args.empty?
if args.empty?
bind_vars = []
else
bind_vars = [nil] + args
end
warn("\#{caller[0]} is calling SQLite3::Database#execute_batch with nil or multiple bind params\nwithout using an array. Please switch to passing bind parameters as an array.\nSupport for this behavior will be removed in version 2.0.0.\n") if $VERBOSE
end
sql = sql.strip
until sql.empty? do
prepare( sql ) do |stmt|
if bind_vars.length == stmt.bind_parameter_count
stmt.bind_params(bind_vars)
end
stmt.step
sql = stmt.remainder.strip
end
end
nil
end