Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IBuffer

A Buffer is an in-memory representation of a database table. This can be used to access table records using find statements.

Hierarchy

  • IBuffer

Index

Properties

name

name: string

The name of the buffer or alias, defaults to the buffer's table name.

record

record: Record

The current record available in the buffer, if any.

tableName

tableName: string

The name of the attached database table, fully qualified.

Methods

create

  • Creates an new record in the table buffer with the values provided and save it. If successful it returns the newly created record and set it as current record into the buffer. Any values set by database triggers are overriding the one set by the user.

    since

    1.1.0

    Parameters

    • values: Record

      The field values to set on the table buffer.

    Returns Promise<Record>

field

  • field(fieldName: string): Promise<IField>
  • Returns the schema of a buffer field.

    Parameters

    • fieldName: string

      The field name.

    Returns Promise<IField>

fields

  • Returns fields schema information for the table buffer.

    Returns Promise<IField[]>

find

  • Find a record in the table that satisfy the filter conditions and returns it. If record found this is also set as current record in the buffer.

    Parameters

    Returns Promise<Record>

indexes

  • indexes(): Promise<IIndex[]>
  • Returns fields schema information for the table buffer.

    Returns Promise<IIndex[]>

table

  • Returns the table meta-data information.

    Returns Promise<ITable>

value

  • Returns the value of a field in the current record if available.

    Parameters

    • fieldName: string
    • Optional extent: number

    Returns FieldValue | FieldValue[]