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[][]

    • Parameters

      • filePaths: string[]
      • outputMessages: boolean

      Returns Promise<boolean>

    • 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>