Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Query

Hierarchy

  • Query

Index

Constructors

constructor

Properties

Private callbacks

callbacks: any

clearWheres

clearWheres: clearWhere

Private formatType

formatType: string

Private froms

Private fromsOriginalValue

fromsOriginalValue: string | Query | IDataSource

Private groupbys

groupbys: any

Private havings

havings: any

histogramColumn

histogramColumn: any

histogramResolution

histogramResolution: any

joins

joins: IQueryJoin

Private materialize

materialize: boolean

Private materializeAccount

materializeAccount: string

Private materializeClassification

materializeClassification: string

Private materializeName

materializeName: string

Private orderbys

orderbys: string[]

orwaiting

orwaiting: any

pending

pending: object

Type declaration

  • [id: string]: object
    • Optional halt?: boolean

pendingid

pendingid: any

previousResponse

previousResponse: any

Private processTableNamesCacheTimeout

processTableNamesCacheTimeout: number

Private projection

projection: string

q

q: any

ready

refreshCallback

refreshCallback: function

Type declaration

    • (data: any, query: Query): void
    • Parameters

      Returns void

refreshInterval

refreshInterval: Interval

refreshSeconds

refreshSeconds: number

Private removeemptycolumns

removeemptycolumns: boolean

Private returnCsv

returnCsv: boolean

Private runCount

runCount: number

selects

selects: any

startCount

startCount: number

takeCount

takeCount: number

Private truncatestringellipsis

truncatestringellipsis: string

Private truncatestringlength

truncatestringlength: number

Private useDataCache

useDataCache: boolean

Private usenullvalues

usenullvalues: boolean

Private wherefirst

wherefirst: any

Private wheres

wheres: IQueryWhere[]

Private withboundingbox

withboundingbox: boolean

Private withgeo

withgeo: boolean

Private withstats

withstats: boolean

Methods

callback

  • callback(func: function): Query
  • Parameters

    • func: function
        • (data: any, query?: Query): void
        • Parameters

          • data: any
          • Optional query: Query

          Returns void

    Returns Query

clearGroupBy

  • clearGroupBy(): void
  • Returns void

clearOrderbys

  • clearOrderbys(): void
  • Returns void

clearWhere

  • clearWhere(): void
  • Returns void

Protected configureRefresh

  • configureRefresh(): void
  • Returns void

Private createApiRequest

Private createApiRequestWithoutPromise

csv

  • csv(bool?: any): void
  • Parameters

    • Optional bool: any

    Returns void

download

  • download(callbackfx: function, formatType?: string, includePolicies?: boolean): void
  • Parameters

    • callbackfx: function
        • (data?: any, query?: any): void
        • Parameters

          • Optional data: any
          • Optional query: any

          Returns void

    • Optional formatType: string
    • Default value includePolicies: boolean = true

    Returns void

from

getRequestQueryJson

  • getRequestQueryJson(asObject?: boolean): IQuery | string
  • Parameters

    • Default value asObject: boolean = false

    Returns IQuery | string

getWheres

groupby

  • groupby(col: any): any
  • Parameters

    • col: any

    Returns any

halt

  • halt(): void
  • Returns void

having

  • having(columnOrObj: any, test: any, value: any): this
  • Parameters

    • columnOrObj: any
    • test: any
    • value: any

    Returns this

histogram

  • histogram(column: any, resolution: any): this
  • Parameters

    • column: any
    • resolution: any

    Returns this

join

  • join(join: IQueryJoin): Query
  • join(table: string, leftcol: string, rightcol: string, method: string): Query
  • Parameters

    Returns Query

  • Parameters

    • table: string
    • leftcol: string
    • rightcol: string
    • method: string

    Returns Query

onReady

  • onReady(callback: function): void

or

  • or(columnOrObj?: any, test?: any, value?: any): Query
  • Parameters

    • Optional columnOrObj: any
    • Optional test: any
    • Optional value: any

    Returns Query

orderby

  • orderby(col: any, dec?: string): this
  • Parameters

    • col: any
    • Optional dec: string

    Returns this

parse

  • parse(url?: string): void
  • Parameters

    • Optional url: string

    Returns void

project

  • project(val: string): this
  • Parameters

    • val: string

    Returns this

queryJson

refresh

  • refresh(callback: function, refreshSeconds?: number): void
  • Parameters

    • callback: function
        • (data: any, query: Query): void
        • Parameters

          Returns void

    • Optional refreshSeconds: number

    Returns void

removeEmptyColumns

  • removeEmptyColumns(val: boolean): this
  • Parameters

    • val: boolean

    Returns this

run

  • run(callbackfx: function, onFailCallback?: function): void
  • Parameters

    • callbackfx: function
        • (data: any, query: Query): void
        • Parameters

          Returns void

    • Default value onFailCallback: function = (error: any = '{No Data}') => {ml.log('Warning: query ran against \'' + this.froms + '\' with no error callback: ' + error);}
        • (error?: any): void
        • Parameters

          • Optional error: any

          Returns void

    Returns void

Private runResults

  • runResults(response: ApiResponse, localscope: any): void
  • Parameters

    Returns void

save

select

  • select(...col: string[]): this
  • Parameters

    • Rest ...col: string[]

    Returns this

setProcessTableNamesCacheTimeout

  • setProcessTableNamesCacheTimeout(value: number): void
  • Parameters

    • value: number

    Returns void

setUseDataCache

  • setUseDataCache(enabled: boolean): this
  • Parameters

    • enabled: boolean

    Returns this

setWheres

  • setWheres(obj: any): this
  • Parameters

    • obj: any

    Returns this

start

  • start(count: number): this
  • Parameters

    • count: number

    Returns this

subQuery

  • subQuery(): object
  • Returns object

take

  • take(count: any): this
  • Parameters

    • count: any

    Returns this

toJSON

toTable

  • toTable(account: string, tablename: string, securityClassification?: string): this
  • Parameters

    • account: string
    • tablename: string
    • Optional securityClassification: string

    Returns this

truncateStringEllipsis

  • truncateStringEllipsis(val: string): this
  • Parameters

    • val: string

    Returns this

truncateStringLength

  • truncateStringLength(val: number): this
  • Parameters

    • val: number

    Returns this

validate

  • validate(callbackfx: function, onFailCallback?: function): void
  • Parameters

    • callbackfx: function
    • Default value onFailCallback: function = (error: any = '{No Data}') => {ml.log('Warning: query ran against \'' + this.froms + '\' with no error callback: ' + error);}
        • (error?: any): void
        • Parameters

          • Optional error: any

          Returns void

    Returns void

where

  • where(exp: string): Query
  • where(whereObject: IQueryWhere, whereFirst?: boolean): Query
  • where(column: string, test: string, value: string | number | string[] | number[], whereFirst?: boolean): Query
  • Parameters

    • exp: string

    Returns Query

  • Parameters

    • whereObject: IQueryWhere
    • Optional whereFirst: boolean

    Returns Query

  • Parameters

    • column: string
    • test: string
    • value: string | number | string[] | number[]
    • Optional whereFirst: boolean

    Returns Query

whereFirst

  • whereFirst(val?: boolean): void
  • Parameters

    • Default value val: boolean = true

    Returns void

withBoundingBox

  • withBoundingBox(val: boolean): this
  • Parameters

    • val: boolean

    Returns this

withGeo

  • withGeo(val: boolean): this
  • Parameters

    • val: boolean

    Returns this

withNull

  • withNull(val: boolean): this
  • Parameters

    • val: boolean

    Returns this

withStats

  • withStats(val: boolean): this
  • Parameters

    • val: boolean

    Returns this

Static defaultQueryParams

  • defaultQueryParams(): object
  • Returns object

    • page: number
    • sort: null
    • sortDescending: boolean
    • take: number
    • where: Array<undefined>

Static fromApiRequest

Static transposeQueryData

  • transposeQueryData(data: any, htmlEncode?: boolean): Array<Object>
  • Parameters

    • data: any
    • Default value htmlEncode: boolean = false

    Returns Array<Object>

Generated using TypeDoc