Zum Hauptinhalt springen

Table

Deprecated

in v23.0.0, Please use SelectBuilder

See

SelectBuilder

Constructors

Constructor

new Table(connection, table?): Table

Parameters

connection

DBConnection

table?

string

Returns

Table

Properties

rows

rows: TableRow[]

Contains all rows that were returned by the select statement

Member Of

Table


columns

columns: string[]

Contains all columns that were returned by the select statement

Member Of

Table

Accessors

isEditable

Get Signature

get isEditable(): boolean

Returns an indicator if the current table instance can modify the Table in Database

Member Of

Table

Returns

boolean


successful

Get Signature

get successful(): boolean

Returns a boolean, that specifies if rows were loaded successful

Member Of

Table

Returns

boolean


count

Get Signature

get count(): number

Returns the count of loaded rows.

Member Of

Table

Returns

number

Methods

load()

load(result, customTypeMapper?): boolean

Loads the complete DBResultSet

Parameters

result

DBResultSet

instance of DBResultSet

customTypeMapper?

(column, value, result) => string | number | Date

Custom Mapper for types. Returns the specified type for a value in a cell

Returns

boolean

  • return true if loaded successful

Member Of

Table


addRow()

addRow(row): void

Adds a new Row. Insert into Database when SaveChanges is called.

Parameters

row

the row you want to insert. Can be an instance of TableRow or Json object.

object | TableRow

Returns

void

Example

table.addRow({
KundenEmail: "test42@test.de",
Kundenname: "One Unity",
Kundennummer: 42
});

Member Of

Table


deleteRow()

deleteRow(row): boolean

Marks the Row that should be deleted. Removes it from Database when SaveChanges is called

Parameters

row

TableRow

The Row you want to delete

Returns

boolean

  • true if successful marked as deleted

Member Of

Table


SaveChanges()

SaveChanges(): SqlResult

Updates all changed date, delete data in table and added new entries

Returns

SqlResult

  • An instance of SqlResult

Member Of

Table