forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Feature Request: Auto Suggest Join Fields
- This topic is empty.
-
AuthorPosts
-
-
May 17, 2011 at 1:21 pm #12334MitchParticipant
If I have two tables, tablea and tableb, and both have “columnc”, if I start typing the following:
Select * from tablea a, tableb b where a.columnc=b.
I would like SQLyog to auto-suggest “columnc”.
-
May 17, 2011 at 2:53 pm #32256peterlaursenParticipant
It does! provided that you have at least PROFESSIONAL version and 'autocomplete' enabled. We just checked the case.
To understand what exact behavior you should expect please read documentation (help .. help menu) SQL Editor .. auto-complete -paragraph.
-
May 17, 2011 at 3:12 pm #32257MitchParticipant
It seems to suggest all of the columns in tableb, but I'd like it to (optionally) choose the matching column name as the first suggestion.
-
May 17, 2011 at 7:00 pm #32258peterlaursenParticipant
I do not understand how a computer program should be able to know what a human user wants to do. After “Select * from tablea a, tableb b where a.” there a still lots of valid queries possible. There may even be more than one column in both tables being named identically so even if we assume a 'JOIN in the WHERE-clause' it is still ambiguous. Also autocomplete is not based on a SQL-parser. It is based on pattern recognition and structured/hierachical information in a local (SQLite) database. Autocomplete has no idea if you want to write a JOIN, a SUBSELECT or whatever. And it even does not know about the syntax of either.
It lists all columns of the table when you type the “-” (dot). But when you have typed “.co” it will display “columnc” (in a 'tooltip') if “columnc” is the only possible match on “co” in the table context (provided taht the option to 'suggest as you type' is enabled).
-
May 17, 2011 at 8:01 pm #32259MitchParticipant
I suggest that there be an additional option that would control whether or not the auto-complete operated this way. Then, using the same example, if there was a “columnc” in tableb and the pattern was recognized, then the first column listed would be “colulmnc” with the new option in effect, or the normal column list if the new option was not in effect.
I recognize that this might take some work on the auto-complete parser, but I think that many users would find this a valuable feature. A large percentage of the queries that I write contain this particular pattern, or an explicit JOIN.
-
May 17, 2011 at 8:10 pm #32260peterlaursenParticipant
I have to disappoint you but we will not do this. Autocomplete has no “SQL awareness”. It only considers what appears in the editor to the right of last “whitespace”. it is not *parsing* – it is *pattern recognition*
Just type as many characters as what are need to ensure that there can be only one match. That is how it is designed – and documented.
-
-
AuthorPosts
- You must be logged in to reply to this topic.