Member Junction
    Preparing search index...

    Base class for SQL Utility functions, you can sub-class this class to create your own SQL Utility functions/override existing functionality.

    Index

    Constructors

    Accessors

    • get dbProvider(): CodeGenDatabaseProvider

      Lazy-initialized database provider. Uses the same factory pattern as ManageMetadataBase and SQLCodeGenBase to resolve the correct provider for the configured database platform.

      Lookup goes through MJGlobal.ClassFactory keyed by the platform string, which matches the @RegisterClass(CodeGenDatabaseProvider, '<platform>') decorators on the concrete providers ('sqlserver', 'postgresql'). Mismatched keys silently fall back to the abstract base class — fail loud with an explicit error so a misconfigured platform doesn't ship as a runtime breakage in dialect-specific methods.

      Returns CodeGenDatabaseProvider

    Methods

    • This method will build a two dimensional array of EntityInfo objects. The first dimension of the array is the level of the entity in the dependency tree. The second dimension of the array is the entities at that level. The entities at each level are NOT dependent on any other entity in that level or any level below it. This method uses the foreign key information witin the Entity Fields array to find these dependencies. self-referencing foreign keys are ignored.

      Parameters

      Returns EntityInfo[][]

    • Executes every file, in order, even after one fails, so a single run surfaces every broken object instead of stopping at the first (each provider logs its own failures). Returns false when any file failed.

      Parameters

      • filePaths: string[]
      • outputMessages: boolean

      Returns Promise<boolean>

    • Parameters

      • type: "function" | "view" | "index" | "sp" | "full_text_search_function"
      • schema: string
      • objectName: string
      • isPermissions: boolean
      • isGenerated: boolean

      Returns string

      Use GetDBObjectFileName.

    • Returns a file name for a given DB Object given a type, schema and object name. The basic format is to have a directory for each schema, and within each directory the file name for each object has this format: ....sql Where in the above format the is only included if the isPermissions flag is true. For example: getDBObjectFileName('view', 'dbo', 'MyView', false, true) => 'dbo/MyView.view.generated.sql' getDBObjectFileName('view', 'dbo', 'MyView', true, true) => 'dbo/MyView.view.permissions.generated.sql' getDBObjectFileName('full_text_search_function', 'dbo', 'tableName', false, true) => 'dbo/tableName.fulltext.generated.sql'

      Parameters

      • type: "function" | "view" | "index" | "sp" | "full_text_search_function"
      • schema: string
      • objectName: string
      • isPermissions: boolean
      • isGenerated: boolean

      Returns string

    • Parameters

      • ds: CodeGenConnection
      • excludeSchemas: string[]
      • applyPermissions: boolean
      • OptionalexcludeEntities: string[]

      Returns Promise<boolean>

    • Refreshes an entity's base view so its cached column list matches the objects it selects from. For a LAYERED entity the CodeGen-owned inner view is refreshed first and the application-owned outer view second: the outer view selects from the inner one, so refreshing it first would bind it to the inner view's stale column list (#4336). The outer refresh is skipped while the outer view does not exist yet (the bootstrap pass of a newly layered entity). Returns false when any refresh failed.

      Parameters

      Returns Promise<boolean>