Functions - lang.table

add

Add record to the table.

close

Releases the database connection. If the table data is fully iterated, it will be automatically closed. This explicit close is required only if it is not fully iterated.

getNext

Retrives the current row and return a record with the data in the columns.

hasNext

Checks for a new row in the given table. If a new row is found, moves the cursor to it.

iterator

Returns an iterator over the members of tbl.

length

Returns the number of members in tbl.

remove

Remove data from the table.

add

(table dt, any data)

returns error | ()

Add record to the table.

Parameters

  • data any
  • A record with data

  • Return Type

    (error | ())
  • An error will be returned if there is any error occurred during adding data or else nil is returned

close

Releases the database connection. If the table data is fully iterated, it will be automatically closed. This explicit close is required only if it is not fully iterated.

Parameters

getNext

(table dt)

returns any

Retrives the current row and return a record with the data in the columns.

Parameters

  • Return Type

    (any)
  • The resulting row as a record

hasNext

(table dt)

returns boolean

Checks for a new row in the given table. If a new row is found, moves the cursor to it.

Parameters

  • Return Type

    (boolean)
  • True if there is a new row; false otherwise

iterator

(table tbl)

returns $anonType$2

Returns an iterator over the members of tbl.

Parameters

length

(table tbl)

returns int

Returns the number of members in tbl.

Parameters

  • Return Type

    (int)

remove

(table dt, function(any) returns (boolean) func)

returns int | error

Remove data from the table.

Parameters

  • func function(any) returns (boolean)
  • The function pointer for delete crieteria

  • Return Type

    (int | error)
  • An int the number of deleted record count or error if any error occurred during removing data