MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_foreign_key_query

Function test_foreign_key_query

tests/test_pgexecute.py:139–148  ·  view source on GitHub ↗
(executor)

Source from the content-addressed store, hash-verified

137
138@dbtest
139def test_foreign_key_query(executor):
140 run(executor, "create schema schema1")
141 run(executor, "create schema schema2")
142 run(executor, "create table schema1.parent(parentid int PRIMARY KEY)")
143 run(
144 executor,
145 "create table schema2.child(childid int PRIMARY KEY, motherid int REFERENCES schema1.parent)",
146 )
147
148 assert set(executor.foreignkeys()) >= {("schema1", "parent", "parentid", "schema2", "child", "motherid")}
149
150
151@dbtest

Callers

nothing calls this directly

Calls 2

runFunction · 0.90
foreignkeysMethod · 0.80

Tested by

no test coverage detected