Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Feature Request: Auto Suggest Join Fields

forums forums SQLyog SQLyog: Bugs / Feature Requests Feature Request: Auto Suggest Join Fields

  • This topic is empty.
Viewing 5 reply threads
  • Author
    Posts
    • #12334
      Mitch
      Participant

      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”.

    • #32256
      peterlaursen
      Participant

      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.

    • #32257
      Mitch
      Participant

      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.

    • #32258
      peterlaursen
      Participant

      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).

    • #32259
      Mitch
      Participant

      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.

    • #32260
      peterlaursen
      Participant

      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.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.