@grandlinex/bundle-postgresql
    Preparing search index...

    Class PGUpdateAbstract

    Abstract helper class for performing database schema updates on PostgreSQL.

    Extends CoreDBUpdate specialized for the PGCon connection type.

    Hierarchy

    • CoreDBUpdate<PGCon>
      • PGUpdate
    Index
    • Parameters

      • srcVersion: string
      • tarVersion: string
      • db: PGCon

      Returns PGUpdate

    srcVersion: string
    tarVersion: string
    • Adds a new column to a database table corresponding to the provided class name.

      Parameters

      • className: string

        The name of the class whose table will be altered. The table name is derived by converting the class name from camelCase to snake_case.

      • columName: string

        The name of the new column to add.

      • type: string

        The SQL data type of the new column (e.g., "INTEGER", "VARCHAR(255)").

      • notNull: boolean

        Whether the new column should be defined as NOT NULL.

      • OptionaldefaultValue: string

        Optional default value for the new column. If supplied, the default is applied unless deleteDefault is true.

      • OptionaldeleteDefault: boolean

        When true and a default value is supplied, the default is dropped after the column is added.

      Returns Promise<boolean>

      A promise that resolves to true if all SQL statements executed successfully, otherwise false.

    • Deletes a column from the database table that corresponds to the given class name.

      Parameters

      • className: string

        The name of the class representing the table. The method converts this name from camelCase to snake_case to derive the actual table name.

      • columName: string

        The name of the column to be removed from the table.

      Returns Promise<boolean>

      A promise that resolves to true when the column has been successfully dropped from all executed queries; otherwise it resolves to false.

    • Parameters

      • version: string

      Returns CoreDBUpdate<PGCon<ICoreKernel<any, ICoreAnyModule>, any, any, any, any>> | null

    • Returns PGCon

    • Returns string

    • Initialize a new table in the database. This method is used to create a new table in the database.

      Parameters

      • className: string

      Returns Promise<boolean>

    • Returns Promise<boolean>

    • Parameters

      • db: CoreDBUpdate<PGCon<ICoreKernel<any, ICoreAnyModule>, any, any, any, any>>

      Returns void

    • Returns Promise<boolean>

    • Returns Promise<boolean>