lib/mini_sql/postgres/connection.rb in mini_sql-1.0.1 vs lib/mini_sql/postgres/connection.rb in mini_sql-1.1.0
- old
+ new
@@ -38,13 +38,19 @@
def initialize(raw_connection, args = nil)
@raw_connection = raw_connection
@deserializer_cache = (args && args[:deserializer_cache]) || self.class.default_deserializer_cache
@param_encoder = (args && args[:param_encoder]) || InlineParamEncoder.new(self)
@type_map = args && args[:type_map]
+
+ @prepared = PreparedConnection.new(self, @deserializer_cache)
end
def type_map
@type_map ||= self.class.type_map(raw_connection)
+ end
+
+ def prepared(condition = true)
+ condition ? @prepared : self
end
# Returns a flat array containing all results.
# Note, if selecting multiple columns array will be flattened
#