lib/mini_sql/mysql/connection.rb in mini_sql-1.0.1 vs lib/mini_sql/mysql/connection.rb in mini_sql-1.1.0
- old
+ new
@@ -7,9 +7,15 @@
def initialize(raw_connection, args = nil)
@raw_connection = raw_connection
@param_encoder = (args && args[:param_encoder]) || InlineParamEncoder.new(self)
@deserializer_cache = (args && args[:deserializer_cache]) || DeserializerCache.new
+
+ @prepared = PreparedConnection.new(self, @deserializer_cache)
+ end
+
+ def prepared(condition = true)
+ condition ? @prepared : self
end
def query_single(sql, *params)
run(sql, :array, params).to_a.flatten!
end