Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5831

Create a SQL Standard Quoter for Use with Connectionless Cases

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 12.4
    • None
    • db - SQL Editor

    Description

      Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the connection", it was found when connectionless case occurs, this prevented auto completion because it relies on connection (DB metadata) based class to return back identifiers which may require further "quoting" to accomidate different DB vendor quotring behavior. When connection is not available, the db metadata based class does not provide back any usable token for use in auto completion and more specifically when quoting these identifier tokens.

      Initial changes in PR-2820 handle specific cases to handled null quoter (due to lack of a connection) where applicable to allow autocompletion without connection to occur. As part of the review of PR, It was suggested to refactor some of this code to develop "ConnectionLess" functionality to better isolate the connection vs connectionless functionality. This may involve development of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on a connection (and metadata based identifiers).

      From NETBEANS-189 comments:

      (6) Potentially larger architectural change may be needed to allow for Connection or Connectionless cases involving changes (rather than case by case changes in a number of places), which may involve introducing a new "Standard SQL Quoter" class for use when connection is not available instead of the Metadata (from the connection based handling of identifiers) which I suggest needs a separate ticket to create a Standard SQL Quoter class and retrofit the code as part of that work.
      The Standard SQl Quoter may involve standardized quoting of identifiers similar to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF ). For this, would need to better understand what the expected input/outputs are for this and what kind of tests would be needed to confirm this does as expected beyond the existing sql tests.
      (7) There may be another SQL improvements ticket to raise to account for additional possible missing autocomplete tokens like what is listed in the w3 reference above which mentions after "SELECT" there can be optionally "DISTINCT | ALL" and either a wildcard ("*"). This is different from selection list of possible connection based identifiers.
      

      Reference:

      1. https://issues.apache.org/jira/browse/NETBEANS-189
      2. https://github.com/apache/netbeans/pull/2820

      Attachments

        Issue Links

          Activity

            People

              ebresie Eric Bresie
              ebresie Eric Bresie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: