Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Editor

Hierarchy

Index

Constructors

constructor

  • new Editor(db?: knex, table?: string | string[], pkey?: string | string[]): Editor
  • Parameters

    • Default value db: knex = null
    • Default value table: string | string[] = null
    • Default value pkey: string | string[] = null

    Returns Editor

Properties

Static Action

Action: Action = Action

Static version

version: string = "1.9.5"

Methods

data

db

  • db(): knex
  • db(db: knex): Editor

dbTransaction

  • dbTransaction(): knex

debug

  • debug(): boolean
  • debug(set: boolean): Editor
  • debug(message: any): Editor

field

fields

idPrefix

  • idPrefix(): string
  • idPrefix(idPrefix: string): Editor

inData

join

leftJoin

  • leftJoin(table: string, field1: string, operator: string, field2: string): Editor
  • Parameters

    • table: string
    • field1: string
    • operator: string
    • field2: string

    Returns Editor

    Self for chaining

leftJoinRemove

  • leftJoinRemove(): boolean
  • leftJoinRemove(remove: boolean): Editor

on

  • on(name: string, callback: Function): Editor
  • Parameters

    • name: string
    • callback: Function

    Returns Editor

    Self for chaining.

pkey

  • pkey(): string[]
  • pkey(pkey: string | string[]): Editor

pkeyToObject

  • pkeyToObject(value: string, flat?: boolean, pkey?: string[]): object
  • Parameters

    • value: string
    • Default value flat: boolean = false
    • Default value pkey: string[] = null

    Returns object

    Array of field values that the id was made up of

pkeyToValue

  • pkeyToValue(row: object, flat?: boolean): string
  • Parameters

    • row: object
    • Default value flat: boolean = false

    Returns string

    The created primary key value.

process

  • Parameters

    Returns Promise<Editor>

    Promise that is fulfilled when Editor has completed its processing - result is the Editor instance.

readTable

  • readTable(): string[]
  • readTable(table: string | string[]): Editor
  • Returns string[]

    Configured read table name

  • Parameters

    • table: string | string[]

    Returns Editor

    Self for chaining

schema

  • schema(): string
  • schema(schema: string): Editor

table

  • table(): string[]
  • table(table: string | string[]): Editor

transaction

  • transaction(): boolean
  • transaction(transaction: boolean): Editor
  • Returns boolean

    true is transactions are enabled, false otherwise.

  • Parameters

    • transaction: boolean

    Returns Editor

    Self for chaining

tryCatch

  • tryCatch(): boolean
  • tryCatch(tryCatch: boolean): Editor

validate

validator

where

  • where(): any[]
  • where(cond: any[]): Editor

whereClear

  • whereClear(): this

write

  • write(writeVal: any): false | true | this
  • Parameters

    • writeVal: any

    Returns false | true | this

Static action

Generated using TypeDoc