(self, fk_data)
| 266 | } |
| 267 | |
| 268 | def extend_foreignkeys(self, fk_data): |
| 269 | # fk_data is a list of ForeignKey namedtuples, with fields |
| 270 | # parentschema, childschema, parenttable, childtable, |
| 271 | # parentcolumns, childcolumns |
| 272 | |
| 273 | # These are added as a list of ForeignKey namedtuples to the |
| 274 | # ColumnMetadata namedtuple for both the child and parent |
| 275 | meta = self.dbmetadata["tables"] |
| 276 | |
| 277 | for fk in fk_data: |
| 278 | e = self.escaped_names |
| 279 | parentschema, childschema = e([fk.parentschema, fk.childschema]) |
| 280 | parenttable, childtable = e([fk.parenttable, fk.childtable]) |
| 281 | childcol, parcol = e([fk.childcolumn, fk.parentcolumn]) |
| 282 | childcolmeta = meta[childschema][childtable][childcol] |
| 283 | parcolmeta = meta[parentschema][parenttable][parcol] |
| 284 | fk = ForeignKey(parentschema, parenttable, parcol, childschema, childtable, childcol) |
| 285 | childcolmeta.foreignkeys.append(fk) |
| 286 | parcolmeta.foreignkeys.append(fk) |
| 287 | |
| 288 | def extend_datatypes(self, type_data): |
| 289 | # dbmetadata['datatypes'][schema_name][type_name] should store type |
no outgoing calls
no test coverage detected