Member Junction
    Preparing search index...

    PostgreSQL DDL, function, migration, introspection and transaction SQL.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    • PostgreSQL folds unquoted identifiers to lowercase, so the physical schema an unquoted CREATE SCHEMA __mj_BizAppsCommon produces is __mj_bizappscommon. Canonicalize to that lowercase form so the engine's quoted operations target the same physical schema as the app's (typically unquoted) migration DDL.

      Parameters

      • name: string

      Returns string

    • PostgreSQL-specific Flyway escape. PostgreSQL string concatenation uses || (not +), and TEXT has no length cap — so a simple split with || suffices and no cast-to-MAX dance is needed (unlike SQL Server, which silently truncates NVARCHAR(N) + NVARCHAR(M) past 4,000 chars). PostgreSQL string literals don't take an N prefix either; everything is already Unicode.

      Parameters

      • sql: string

      Returns string

    • PostgreSQL FK-graph query for cascade planning — reads pg_catalog.pg_constraint (contype = 'f'). Returns one row per FK column (via unnest(conkey, confkey), which preserves column pairing/order), with childNullable (NOT attnotnull) and colCount (array_length(conkey, 1), for composite exclusion). Column aliases and semantics MATCH the SQL Server variant so a single caller parses both. relname/attname preserve the quoted mixed-case identifiers MJ creates on PG, so they feed straight into QuoteIdentifier. Both parent + child are filtered to schema; the schema is embedded as a literal.

      Parameters

      • schema: string

      Returns string

    • PostgreSQL function parameters use a p_<flat lowercase> convention (no @-prefix syntax in PG). This matches the baseline-ported SP names (which lowercased SQL Server's PascalCase parameter names without separators — e.g. @CompanyID → p_companyid) and the runtime PostgreSQLDataProvider, which calls procs with p_${field.Name.toLowerCase()}.

      Earlier this used a snake_case transform (p_company_id), which produced functions the runtime could never invoke. Underscores already in the input (e.g. the _Clear companion suffix) are preserved.

      Parameters

      • name: string

      Returns string

    • Splits an oversized SQL batch into individual statements on ;+EOL boundaries — but NEVER inside a PostgreSQL dollar-quoted block ($$ … $$ or $tag$ … $tag$), whose body legitimately contains ;+newline (DO blocks, PL/pgSQL function bodies, the integration view-drop guard $mj_dropviews$). A naive split(/;\s*\n/g) tears those apart. Outside dollar blocks the boundary semantics mirror the base split(/;\s*\n/g) (a ; then optional inline whitespace then a newline). Each returned statement ends with ;.

      Parameters

      • batch: string

      Returns string[]