Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-30634

Query commenting in Query Workbench (usability)

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • query, UI

    Description

      Summary: Commenting in the query workbench causes the syntax highlighting to change, but a query with comments in it will cause an error.

      Repro:

      1. Open Query Builder
      2. Enter a valid query and some comments. (example:
        1. – this is a comment
        2. SELECT * FROM `travel-sample` LIMIT 10;
      3. Click execute

      Expected:

      The comment to be ignored and the un-commented query to execute.

      Actual:

      Error message: syntax error

      Notes:

      In the 5.5 release, using "–" for commenting doesn't seem to affect the syntax highlighting anymore. Still, "–" or "#" is widely expected by SQL users to function as a comment, as I have observed giving a N1QL demo to 200-300 people at recent conferences.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          eben Eben Haber added a comment -

          Apparently "–" has never been supported by N1QL as a comment character, instead it uses "/" and "/".

          The syntax highlighting incorrectly highlit "–" because it was originally copied from SQL, but that was fixed in Vulcan.

          I can't comment on the larger question as to whether "–" should be supported as the beginning of a comment.

          eben Eben Haber added a comment - Apparently "–" has never been supported by N1QL as a comment character, instead it uses "/ " and " /". The syntax highlighting incorrectly highlit "–" because it was originally copied from SQL, but that was fixed in Vulcan. I can't comment on the larger question as to whether "–" should be supported as the beginning of a comment.

          Interesting! I'm assuming your comment got mangled but it's slash-star-comment-star-slash, i.e. C multi-line comment style.

          /* this is a comment */
          SELECT * FROM `travel-sample` LIMIT 10;

          And that works how I'd expect! For SQL, I think that commenting style is unusual, but it works. So I guess just take this ticket as a suggestion to support – or # instead of or in addition to.

          matthew.groves Matthew Groves added a comment - Interesting! I'm assuming your comment got mangled but it's slash-star-comment-star-slash, i.e. C multi-line comment style. /* this is a comment */ SELECT * FROM `travel-sample` LIMIT 10; And that works how I'd expect! For SQL, I think that commenting style is unusual, but it works. So I guess just take this ticket as a suggestion to support – or # instead of or in addition to.
          eben Eben Haber added a comment -

          Matthew Groves - that is correct - C/Java-style comments. The one advantage is that you can comment out many lines. In any case, any action on this will be up to the query team.

          eben Eben Haber added a comment - Matthew Groves - that is correct - C/Java-style comments. The one advantage is that you can comment out many lines. In any case, any action on this will be up to the query team.

          People

            keshav Keshav Murthy
            matthew.groves Matthew Groves
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty