'param_3': 3, 'param_2': 2}
)
+ def test_array_literal_compare(self):
+ self.assert_compile(
+ postgresql.array([1, 2]) == [3, 4, 5],
+ "ARRAY[%(param_1)s, %(param_2)s] = "
+ "ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]",
+ checkparams={'param_5': 5, 'param_4': 4, 'param_1': 1,
+ 'param_3': 3, 'param_2': 2}
+
+ )
+
def test_array_literal_insert(self):
m = MetaData()
t = Table('t', m, Column('data', postgresql.ARRAY(Integer)))
eq_(len(results), 1)
eq_(results[0][0], [1, 2, 3, 4, 5, 6, ])
+ def test_array_comparison(self):
+ arrtable = self.tables.arrtable
+ arrtable.insert().execute(intarr=[1, 2, 3],
+ strarr=[util.u('abc'), util.u('def')])
+ results = select([arrtable.c.id]).\
+ where(arrtable.c.intarr < [4, 5, 6]).execute()\
+ .fetchall()
+ eq_(len(results), 1)
+ eq_(results[0][0], 3)
+
def test_array_subtype_resultprocessor(self):
arrtable = self.tables.arrtable
arrtable.insert().execute(intarr=[4, 5, 6],
), [1, 2, 3, 4, 5]
)
+ def test_array_literal_compare(self):
+ eq_(
+ testing.db.scalar(
+ select([
+ postgresql.array([1, 2]) < [3, 4, 5]
+ ])
+ ), True
+ )
+
def test_array_getitem_single_type(self):
arrtable = self.tables.arrtable
is_(arrtable.c.intarr[1].type._type_affinity, Integer)