summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_multiple_schemata.py
diff options
context:
space:
mode:
authorkoljonen <koljonen@outlook.com>2016-05-26 01:15:14 +0200
committerkoljonen <koljonen@outlook.com>2016-06-09 00:55:07 +0200
commit9b6a72e9e00bae4c1247153205e90ba549e2f1ea (patch)
tree422ce96192ce3c7c03f4f7030e74c907e0ad0797 /tests/test_smart_completion_multiple_schemata.py
parent59aacd68073b1ba017ed77de87284c3fd3a1ad94 (diff)
For 'JOIN <cursor>', suggest 'foo on foo.fooid = bar.fooid'
This is based on my previous work on suggesting join conditions, but here instead we suggest the whole join. What we do is simply check all the tables in the statement for FK relationships and then suggest joins based on those. I think this will not only save key presses, but also be rather useful when exploring an unfamiliar (part of a) database. There's one non-obvious change in this commit (that I can think of): When calling **sqlcompletion.text_before_cursor**, the **text_before_cursor** argument now no longer includes **word_before_cursor**. This is because for 'SELECT * FROM foo JOIN bar<cursor>', we would otherwise consider the table **bar** already included in the statement and thus suggest e.g. 'baz on baz.barid = bar.barid'.
Diffstat (limited to 'tests/test_smart_completion_multiple_schemata.py')
0 files changed, 0 insertions, 0 deletions