mesa-find
pagination, multi-column-searching and sorting for mesa tables
Last updated 7 years ago by snd .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mesa-find 
SYNC missed versions from official npm registry.

mesa-find

mesa-find enables pagination, multi-column-searching and sorting on mesa tables

install

npm install mesa-find

use

mesa = require 'mesa'
find = require 'mesa-find'
pg = require 'pg'

userTable = mesa
    .table('user')
    .connection((cb) -> pg.create 'tcp://foo@localhost/bar', cb)

find userTable, {
    page: 3                         # optional (pages start at 1)
    recordsPerPage: 50              # required when page is set

    search: 'ann'                   # optional, has no effect when it is the empty string
    searchableColumns: ['name']     # defaults to [] which makes search have no effect

    sortBy: 'age'                   # optional
    sortAscending: false            # defaults to true
}, (err, results) ->
    console.log results.pageCount
    console.log results.recordCount
    console.log results.records

license: MIT

Current Tags

  • 0.3.1                                ...           latest (7 years ago)

5 Versions

  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |