Reset the conversion procs when extending the Database object, so it will pick up the array convertors. This is only done for the native postgres adapter.
# File lib/sequel/extensions/pg_array.rb, line 103 def self.extended(db) db.reset_conversion_procs if db.respond_to?(:reset_conversion_procs) end
Handle arrays in bound variables
# File lib/sequel/extensions/pg_array.rb, line 108 def bound_variable_arg(arg, conn) case arg when PGArray bound_variable_array(arg.to_a) when Array bound_variable_array(arg) else super end end
Make the column type detection deal with string and numeric array types.
# File lib/sequel/extensions/pg_array.rb, line 120 def schema_column_type(db_type) case db_type when %r\A(character( varying)?|text).*\[\]\z/o :string_array when %r\A(integer|bigint|smallint)\[\]\z/o :integer_array when %r\A(real|double precision)\[\]\z/o :float_array when %r\Anumeric.*\[\]\z/o :decimal_array else super end end