MCPcopy Create free account
hub / github.com/SOCI/soci / SetupForeignKeys

Method SetupForeignKeys

tests/sqlite3/test-sqlite3.cpp:100–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98{
99public:
100 explicit SetupForeignKeys(soci::session& sql)
101 : m_sql(sql)
102 {
103 m_sql <<
104 "create table parent ("
105 " id integer primary key"
106 ")";
107
108 m_sql <<
109 "create table child ("
110 " id integer primary key,"
111 " parent integer,"
112 " foreign key(parent) references parent(id)"
113 ")";
114
115 m_sql << "insert into parent(id) values(1)";
116 m_sql << "insert into child(id, parent) values(100, 1)";
117 }
118
119 ~SetupForeignKeys()
120 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected