Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ITable

Specifies the information about a table in a Progress database.

Hierarchy

  • ITable

Index

Properties

database

database: IDatabase

Link back to the database this table belongs to.

Optional description

description: string

The description of this table.

fullName

fullName: string

The qualified name of the table, including the database name.

name

name: string

The table name.

Methods

count

  • count(filter?: Filter): Promise<number>
  • Returns the number records in the table.

    Parameters

    Returns Promise<number>

create

  • Creates a new record in the table and returns the newly created record.

    since

    1.1.0

    Parameters

    • values: Record

      The field values to set when the query is executed.

    Returns Promise<IBuffer>

delete

  • delete(filter: Filter): Promise<number>
  • Delete the table records that satisfy the filter condition and returns the number of records affected (deleted).

    Parameters

    • filter: Filter

      The filter condition for the table.

    Returns Promise<number>

find

  • Find a record in the table that satisfy the filter conditions and, if found, returns a buffer holding that record.

    Parameters

    • filter: Filter

      The filter condition for the table.

    • Optional mode: FindMode

    Returns Promise<IBuffer>

getField

  • getField(field: string | number): Promise<IField>
  • Returns the information about one field of the table. If the type of "field" is string, it returns the field with the given name from the table. If the type of "field" is number, it returns the Nth field from the table.

    Parameters

    • field: string | number

    Returns Promise<IField>

getFields

  • getFields(): Promise<IField[]>
  • Return information about all fields present on this table.

    Returns Promise<IField[]>

getIndex

  • getIndex(index: string | number): Promise<IIndex>
  • Returns the information about one index of the table. If the type of "index" is string, it returns the index with the given name of the table. If the type of "index" is number, it returns the Nth index of the table.

    Parameters

    • index: string | number

    Returns Promise<IIndex>

getIndexes

  • getIndexes(): Promise<IIndex[]>
  • Return information about all indexes present on this table.

    Returns Promise<IIndex[]>

getNumFields

  • getNumFields(): Promise<number>
  • Returns the number of fields of the table.

    Returns Promise<number>

getNumIndexes

  • getNumIndexes(): Promise<number>
  • Returns the number of indexes of the table.

    Returns Promise<number>

getPrimaryKey

  • getPrimaryKey(): Promise<IIndex>
  • Returns the primary key of the table, if any.

    Returns Promise<IIndex>

insert

  • Alias for create.

    since

    1.1.0

    Parameters

    • values: Record

      The field values to set when the query is executed.

    Returns Promise<IBuffer>

select

  • select(filter?: Filter, offset?: number, limit?: number): Promise<Record[]>
  • Returns all table records that satisfy the filter condition.

    Parameters

    • Optional filter: Filter

      The filter condition for the table.

    • Optional offset: number
    • Optional limit: number

    Returns Promise<Record[]>

update

  • Updates one or more records that satisfy the filter selection in the table and returns the number of records affected.

    since

    1.1.0

    Parameters

    • values: Record

      The field values to set when the query is executed.

    • Optional filter: Filter

      The filter condition for the table.

    Returns Promise<number>

upsert

  • Updates, or create a new record if not found, in the table and returns the record data.

    since

    1.1.0

    Parameters

    • values: Record

      The field values to set when the query is executed.

    Returns Promise<IBuffer>