Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Datastore

Hierarchy

  • Datastore

Index

Properties

dataClasses

Collection of available datastore classes

Methods

commit

  • commit(): void
  • Accepts the transaction opened by the ds.startTransaction() method at the corresponding level in the current context

    Returns void

exportAsJSON

  • exportAsJSON(exportFolder: WAKFolderInstance, numFiles: Number, fileLimitSize: Number, attLimitSize?: Number): void
  • exports all the entities stored in the object for which it is called in JSON format

    Parameters

    • exportFolder: WAKFolderInstance
    • numFiles: Number
    • fileLimitSize: Number
    • Optional attLimitSize: Number

    Returns void

exportAsSQL

  • exportAsSQL(exportFolder: WAKFolderInstance, numFiles: Number, fileLimitSize: Number, attLimitSize?: Number): void
  • exports all the entities stored the object for which it is called in SQL format

    Parameters

    • exportFolder: WAKFolderInstance
    • numFiles: Number
    • fileLimitSize: Number
    • Optional attLimitSize: Number

    Returns void

flushCache

  • flushCache(): void

getCacheSize

  • getCacheSize(): Number
  • returns the size of memory used by the datastore cache (in bytes)

    Returns Number

getDataFolder

getMeasures

  • getMeasures(options?: Object): Object
  • allows you to get detailed information about Wakanda database engine events

    Parameters

    • Optional options: Object

    Returns Object

getModelFolder

getName

  • getName(): String
  • returns the name of the current datastore

    Returns String

getTempFolder

importFromJSON

  • imports all the entities stored in JSON format from the file(s) located in the importFolder folder

    Parameters

    Returns void

pauseTransaction

  • pauseTransaction(): void
  • Pause a transaction opened by the ds.startTransaction() method in the current context

    Returns void

resumeTransaction

  • resumeTransaction(): void
  • Resume a transaction paused by the ds.pauseTransaction() method in the current context

    Returns void

revealGhostTables

  • revealGhostTables(): void
  • looks for any "ghost" tables in the data file of your application and adds the corresponding datastore classes to the loaded model

    Returns void

rollBack

  • rollBack(): void
  • Cancels the transaction opened by the ds.startTransaction() method at the corresponding level in the current context

    Returns void

setCacheSize

  • setCacheSize(newSize: Number): void
  • increase dynamically the datastore cache size

    Parameters

    • newSize: Number

    Returns void

startTransaction

  • startTransaction(): void
  • Starts a transaction in the current context

    Example

    model.Invoice.events.remove = function(){
        if (this.invoiceItems.length != 0){
            ds.startTransaction();            //start a transaction
            this.invoiceItems.remove();        //attempt to delete the invoiceItems
            // if all went well, the commit will be done automatically
            // if there is an error, the transaction will rollback
        }
    }

    Returns void

transactionLevel

  • transactionLevel(): Number
  • Returns the level of the current transaction for the context

    Returns Number

    Number Level of the current transaction (0 if no transaction was started)