MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _make_tables

Method _make_tables

test/ext/test_automap.py:662–680  ·  view source on GitHub ↗
(self, e)

Source from the content-addressed store, hash-verified

660 __only_on__ = "sqlite+pysqlite"
661
662 def _make_tables(self, e):
663 m = MetaData()
664 for i in range(15):
665 Table(
666 "table_%d" % i,
667 m,
668 Column("id", Integer, primary_key=True),
669 Column("data", String(50)),
670 (
671 Column(
672 "t_%d_id" % (i - 1),
673 ForeignKey("table_%d.id" % (i - 1)),
674 )
675 if i > 4
676 else None
677 ),
678 )
679 m.drop_all(e)
680 m.create_all(e)
681
682 def _automap(self, e):
683 Base = automap_base()

Callers 1

_chaosMethod · 0.95

Calls 7

drop_allMethod · 0.95
create_allMethod · 0.95
MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
StringClass · 0.90
ForeignKeyClass · 0.90

Tested by

no test coverage detected