Options
All
  • Public
  • Public/Protected
  • All
Menu

Class nanoSQL

Hierarchy

  • nanoSQL

Implements

Index

Constructors

constructor

Properties

dbs

dbs: object

Type declaration

functions

functions: object

Type declaration

indexTypes

indexTypes: object

Type declaration

  • [type: string]: function
      • (value: any): any
      • Parameters

        • value: any

        Returns any

planetRadius

planetRadius: number = 6371

selectedDB

selectedDB: string

selectedTable

selectedTable: any

version

version: number = VERSION

Methods

CSVtoJSON

  • CSVtoJSON(csv: string, rowMap?: undefined | function): any
  • Parameters

    • csv: string
    • Optional rowMap: undefined | function

    Returns any

JSONtoCSV

  • JSONtoCSV(json: any[], printHeaders?: undefined | false | true, useHeaders?: string[]): string
  • Parameters

    • json: any[]
    • Optional printHeaders: undefined | false | true
    • Optional useHeaders: string[]

    Returns string

_checkTTL

  • _checkTTL(): void

_doAV

  • _doAV(AVType: "a" | "v", table: string, AVName: string, AVArgs: any): Promise<any>
  • Parameters

    • AVType: "a" | "v"
    • table: string
    • AVName: string
    • AVArgs: any

    Returns Promise<any>

_initPeers

  • _initPeers(): void

_initPlugins

_rebuildFKs

  • _rebuildFKs(): void

_refreshEventChecker

_saveTableIds

  • _saveTableIds(): Promise<any>

clearCache

  • clearCache(id: string): boolean
  • Parameters

    • id: string

    Returns boolean

clearTTL

  • clearTTL(primaryKey: any): Promise<any>
  • Parameters

    • primaryKey: any

    Returns Promise<any>

connect

createDatabase

csvToArray

  • csvToArray(text: string): any[]

default

  • default(databaseID: string | undefined, replaceObj?: any, table?: undefined | string): object | Error
  • Parameters

    • databaseID: string | undefined
    • Optional replaceObj: any
    • Optional table: undefined | string

    Returns object | Error

disconnect

  • disconnect(dbID?: undefined | string): Promise<Object>
  • Parameters

    • Optional dbID: undefined | string

    Returns Promise<Object>

doAction

  • doAction(actionName: string, actionArgs: any): Promise<any>
  • Parameters

    • actionName: string
    • actionArgs: any

    Returns Promise<any>

doFilter

  • doFilter<T>(databaseID: string | undefined, filterName: string, args: T, complete: function, cancelled: function): void
  • Type parameters

    • T

    Parameters

    • databaseID: string | undefined
    • filterName: string
    • args: T
    • complete: function
        • (result: T): void
        • Parameters

          • result: T

          Returns void

    • cancelled: function
        • (abortInfo: any): void
        • Parameters

          • abortInfo: any

          Returns void

    Returns void

dropDatabase

  • dropDatabase(id: string): Promise<any>
  • Parameters

    • id: string

    Returns Promise<any>

every

  • every(args: object): number[]
  • Parameters

    • args: object
      • Optional every?: undefined | number
      • length: number
      • Optional offset?: undefined | number

    Returns number[]

expires

  • expires(primaryKey: any): Promise<any>
  • Parameters

    • primaryKey: any

    Returns Promise<any>

extend

  • extend(scope: string, ...args: any[]): any | nanoSQL

getCache

  • getCache(id: string, args?: undefined | object): any[]
  • Parameters

    • id: string
    • Optional args: undefined | object

    Returns any[]

getDB

getPeers

  • getPeers(): any

getView

  • getView(viewName: string, viewArgs: any): Promise<any>
  • Parameters

    • viewName: string
    • viewArgs: any

    Returns Promise<any>

listDatabases

  • listDatabases(): string[]

loadCSV

  • loadCSV(csvString: string, rowMap?: undefined | function, onProgress?: undefined | function, parallel?: undefined | false | true): Promise<any[]>
  • Parameters

    • csvString: string
    • Optional rowMap: undefined | function
    • Optional onProgress: undefined | function
    • Optional parallel: undefined | false | true

    Returns Promise<any[]>

loadJS

  • loadJS(rows: object[], onProgress?: undefined | function, parallel?: undefined | false | true): Promise<any[]>
  • Parameters

    • rows: object[]
    • Optional onProgress: undefined | function
    • Optional parallel: undefined | false | true

    Returns Promise<any[]>

off

  • off(action: string, callBack: function, selectTable?: undefined | string): void

on

  • on(action: string, callBack: function, selectTable?: undefined | string): void

presetQuery

query

rawDump

  • rawDump(tables: string[], indexes: boolean, onRow: function): Promise<any>
  • Parameters

    • tables: string[]
    • indexes: boolean
    • onRow: function
        • (table: string, row: object): void
        • Parameters

          • table: string
          • row: object
            • [key: string]: any

          Returns void

    Returns Promise<any>

rawImport

  • rawImport(tables: object, indexes: boolean, onProgress?: undefined | function): Promise<any>
  • Parameters

    • tables: object
      • [table: string]: object[]
    • indexes: boolean
    • Optional onProgress: undefined | function

    Returns Promise<any>

selectTable

triggerEvent

triggerQuery

  • triggerQuery(databaseID: string | undefined, query: InanoSQLQuery, onRow: function, complete: function, error: function): void
  • Parameters

    • databaseID: string | undefined
    • query: InanoSQLQuery
    • onRow: function
        • (row: any): void
        • Parameters

          • row: any

          Returns void

    • complete: function
        • (): void
        • Returns void

    • error: function
        • (err: string): void
        • Parameters

          • err: string

          Returns void

    Returns void

useDatabase

Generated using TypeDoc