MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_expression_index

Method test_expression_index

test/sql/test_metadata.py:6485–6494  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6483 eq_(t2b.primary_key.name, "t2_pk")
6484
6485 def test_expression_index(self):
6486 m = MetaData(naming_convention={"ix": "ix_%(column_0_label)s"})
6487 t = Table("t", m, Column("q", Integer), Column("p", Integer))
6488 ix = Index(None, t.c.q + 5)
6489 t.append_constraint(ix)
6490
6491 # huh. pretty cool
6492 self.assert_compile(
6493 CreateIndex(ix), "CREATE INDEX ix_t_q ON t (q + 5)"
6494 )
6495
6496
6497class CopyDialectOptionsTest(fixtures.TestBase):

Callers

nothing calls this directly

Calls 7

append_constraintMethod · 0.95
MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
IndexClass · 0.90
CreateIndexClass · 0.85
assert_compileMethod · 0.80

Tested by

no test coverage detected