Exemplo n.º 1
0
 def _ix_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('x', String()), Column('y', Integer),
               Index('ix1', 'y'))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 2
0
 def _sql_ck_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('email', String()))
     t.append_constraint(CheckConstraint(t.c.email.like('%@%')))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 3
0
 def _uq_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('x', String()), Column('y', Integer),
               UniqueConstraint('y', name='uq1'))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 4
0
 def _enum_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('thing', Enum('a', 'b', 'c')))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 5
0
 def _boolean_no_ck_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('flag', Boolean(create_constraint=False)))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 6
0
 def _boolean_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('flag', Boolean))
     return ApplyBatchImpl(t, table_args, table_kwargs)
Exemplo n.º 7
0
 def _selfref_fk_fixture(self, table_args=(), table_kwargs={}):
     m = MetaData()
     t = Table('tname', m, Column('id', Integer, primary_key=True),
               Column('parent_id', Integer, ForeignKey('tname.id')),
               Column('data', String))
     return ApplyBatchImpl(t, table_args, table_kwargs)