Class GlobalScope

Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
gudusoft.gsqlparser.resolver2.scope.GlobalScope
All Implemented Interfaces:
IScope

public class GlobalScope extends AbstractScope
Global scope - contains session-level objects and metadata. This is typically the root of the scope tree.

Responsibilities:

  1. Access to global metadata (SQLEnv)
  2. Database/schema context with proper qualified name resolution
  3. Session variables and settings

Qualified Name Resolution

When resolving table names, this scope uses QualifiedNameResolver to properly handle partial names (e.g., just "table" or "schema.table") by applying default catalog/schema from TSQLEnv.

Example: With default catalog="mydb" and schema="dbo":

  • "users" matches "mydb.dbo.users"
  • "hr.employees" matches "mydb.hr.employees"
  • "otherdb.hr.employees" matches exactly
See Also:
  • Constructor Details

    • GlobalScope

      public GlobalScope(gudusoft.gsqlparser.compiler.TContext globalContext, INameMatcher nameMatcher)
    • GlobalScope

      public GlobalScope(gudusoft.gsqlparser.compiler.TContext globalContext, INameMatcher nameMatcher, TSQLEnv sqlEnv, EDbVendor vendor)
      Create a GlobalScope with SQL environment for qualified name resolution.
      Parameters:
      globalContext - The global parser context
      nameMatcher - The name matcher for case sensitivity
      sqlEnv - The SQL environment with default catalog/schema
      vendor - The database vendor
  • Method Details