TubDatabase_

TubDatabase_

Class for database access. Databases are defined in config file

Constructor

new TubDatabase_(index)

Arguments:
  1. index (number)

Members

inTransaction

Is database in transaction

Methods

startTransaction()boolean

Start transaction. If transaction is already started return false

commit()boolean

Commit transaction. If transaction is not started return false

rollback()boolean

Rollback transaction. If transaction is not started return false

run(sql, params)string

Run select sql and return result
Arguments:
  1. sql (string)
  2. params (Object)

exec(sql, params)boolean

Execute sql
Arguments:
  1. sql (string)
  2. params (Object)

genID(entity)number

Generate ID for entity
Arguments:
  1. entity (string)