Skip to content

Commit

Permalink
Fixing attribute error for column meta data. (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMeemus authored May 10, 2018
1 parent df77206 commit 887f571
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mssqlcli/mssqlcompleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def get_join_matches(self, suggestion, word_before_cursor):
joins = []
# Iterate over FKs in existing tables to find potential joins
fks = ((fk, rtbl, rcol) for rtbl, rcols in cols.items()
for rcol in rcols for fk in rcol.get_foreign_keys)
for rcol in rcols for fk in rcol.foreignkeys)
col = namedtuple('col', 'schema tbl col')
for fk, rtbl, rcol in fks:
right = col(rtbl.schema, rtbl.name, rcol.name)
Expand Down Expand Up @@ -614,7 +614,7 @@ def list_dict(pairs): # Turns [(a, b), (a, c)] into {a: [b, c]}
for t, c in cols if t.ref != lref)
# For each fk from the left table, generate a join condition if
# the other table is also in the scope
fks = ((fk, lcol.name) for lcol in lcols for fk in lcol.get_foreign_keys)
fks = ((fk, lcol.name) for lcol in lcols for fk in lcol.foreignkeys)
for fk, lcol in fks:
left = col(ltbl.schema, ltbl.name, lcol)
child = col(fk.childschema, fk.childtable, fk.childcolumn)
Expand Down

0 comments on commit 887f571

Please sign in to comment.