Member Junction
    Preparing search index...

    Function resolveCodeGenDatabaseProvider

    • Resolve the concrete CodeGenDatabaseProvider registered for a given platform via MJGlobal.Instance.ClassFactory. This is the single source of truth for platform dispatch — the orchestrator (RunCodeGenBase.setupDataSource()) delegates to this function rather than re-implementing the lookup. Tests import this function directly so they exercise the real dispatch logic instead of a transcribed copy.

      ClassFactory.CreateInstance returns the abstract base class itself on a missed registration lookup (it does not throw). We disambiguate by checking constructor === CodeGenDatabaseProvider and throw a descriptive error so the failure mode reads as "no provider registered" instead of a cryptic "is not a constructor" / "is not a function" downstream.

      Parameters

      • platform: DatabasePlatform

        The dbPlatform key — typically 'sqlserver' or 'postgresql'.

      Returns CodeGenDatabaseProvider

      The resolved provider subclass instance.

      Error if no provider is registered for the given platform.