Enum DisplayNameMode

Object
Enum<DisplayNameMode>
gudusoft.gsqlparser.resolver2.format.DisplayNameMode
All Implemented Interfaces:
Serializable, Comparable<DisplayNameMode>, java.lang.constant.Constable

public enum DisplayNameMode extends Enum<DisplayNameMode>
Controls how identifier names are rendered for display output.

This mode determines the "visual style" of the output - whether to show raw SQL form with quotes, clean display form without quotes, or canonical form.

Note: This is separate from DisplayNamePolicy which determines "which occurrence to use" when the same object appears multiple times with different spellings.

Example with SQL Server:

 SQL: SELECT [OrderID] FROM [dbo].[SalesOrder]

 DISPLAY:    dbo.SalesOrder, OrderID (quotes stripped, case preserved)
 SQL_RENDER: [dbo].[SalesOrder], [OrderID] (quotes preserved)
 CANONICAL:  dbo.salesorder, orderid (vendor-specific folding applied)
 
See Also:
  • Enum Constant Details

    • DISPLAY

      public static final DisplayNameMode DISPLAY
      Display mode: strip delimiters, preserve original case.

      Recommended for debugging and test output. Produces clean, readable output that reflects what the user wrote (minus the quote noise).

      Examples:

      • [OrderID]OrderID
      • `kalyan-DB`kalyan-DB
      • "MyTable"MyTable
    • SQL_RENDER

      public static final DisplayNameMode SQL_RENDER
      SQL render mode: preserve delimiters for valid SQL regeneration.

      Use when output needs to be valid SQL that can be re-executed. Preserves necessary quotes/brackets for special characters and reserved words.

      Examples:

      • [Order ID][Order ID] (space requires brackets)
      • `kalyan-DB``kalyan-DB` (hyphen requires backticks)
    • CANONICAL

      public static final DisplayNameMode CANONICAL
      Canonical mode: apply vendor-specific case folding.

      Produces output matching the database's internal canonical form. Useful for comparing against metadata or catalog information.

      Examples (vendor-dependent):

      • Oracle: MyTableMYTABLE (unquoted folds to upper)
      • PostgreSQL: MyTablemytable (unquoted folds to lower)
      • BigQuery: MyTableMyTable (case-sensitive)
  • Method Details

    • values

      public static DisplayNameMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DisplayNameMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null