Options
All
  • Public
  • Public/Protected
  • All
Menu

Storage service allows components and actions to interact with Zyllio tables

It provides methods to retrieve / update / create / delete data

Hierarchy

  • StorageInterface

Index

Methods

  • countRows(tableId: string, query?: QueryModel): Promise<number>
  • Count the table rows of the specified table

    Query parameter is an object that filters the data

    // Retrieve the rows which have 'City' column equals to 'London'
    const query = {
    'City': 'London'
    }

    Parameters

    • tableId: string

      Id of the table

    • Optional query: QueryModel

      An optional object to filter data

    Returns Promise<number>

    Null if table not found, undefined if remote error, number of rows otherwise

  • createRow(tableId: string, data: TableRowModel): Promise<boolean>
  • Creates a single row within the specified table

    Parameters

    • tableId: string

      Id of the table

    • data: TableRowModel

      A single row to be inserted

    Returns Promise<boolean>

  • deleteRow(tableId: string, rowId: string): Promise<boolean>
  • Deletes the specified row from the specified table

    Parameters

    • tableId: string

      Id of the table

    • rowId: string

      Id of the row to delete

    Returns Promise<boolean>

  • retrieveRows(tableId: string, query?: QueryModel): Promise<TableRowsModel>
  • Retrieves rows from the specified table

    Query parameter is an object that filters the data

    // Retrieve the rows which have 'City' column equals to 'London'
    const query = {
    'City': 'London'
    }

    Parameters

    • tableId: string

      Id of the table

    • Optional query: QueryModel

      An optional object to filter data

    Returns Promise<TableRowsModel>

    Null if table not found, undefined if remote error, table rows otherwise

  • updateRow(tableId: string, rowId: string, data: TableRowModel): Promise<boolean>
  • Updates a single row within the specified table

    Parameters

    • tableId: string

      Id of the table

    • rowId: string

      Unique Id of the row to update

    • data: TableRowModel

      The new row

    Returns Promise<boolean>