# oly-sqlize

> Library of Sequelize tools

Latest version **0.0.10** (published 2018-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install oly-sqlize
pnpm add oly-sqlize
yarn add oly-sqlize
bun add oly-sqlize
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2018-07-27 |
| First published | 2018-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 62.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Olympusat Development Team |
| Maintainers | olympusat |
| Keywords | sequelize, node, derp |

## Links

- npm: https://www.npmjs.com/package/oly-sqlize
- Repository: oly-sqlize
- npm.io page: https://npm.io/package/oly-sqlize

## Dependencies (3)

- [bluebird](https://npm.io/package/bluebird.md) ^3.5.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.12
- [sequelize-typescript](https://npm.io/package/sequelize-typescript.md) ^0.6.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.10 (latest) — 2018-07-27
- 0.0.9 — 2018-07-10
- 0.0.8 — 2018-06-07
- 0.0.7 — 2018-06-04
- 0.0.6 — 2018-05-25
- 0.0.5 — 2018-05-17
- 0.0.4 — 2018-04-02
- 0.0.3 — 2018-04-02
- 0.0.2 — 2018-04-02
- 0.0.1 — 2018-03-30

## README

Add curser based pagination to sequelize

## Installation
`npm install oly-sqlize`

## Example
~~~~ javascript
  // In sequelize models index.js

  // es6 modules
  import { Paginator } from 'oly-sqlize';

  // commonjs
  const Paginator = require('oly-sqlize').Paginator;

  // Using object destructuring
  const { Paginator } = require('oly-sqlize');


  // Add pagination options
  const paginationOptions = {
    methodName: 'paginate',
    primaryKeyField: 'id',
  };

  const addModelPagination = Paginator(paginationOptions);

  // Attach to all your models
  Object.keys(db).forEach((modelName) => {
    if (db[modelName].associate) {
      db[modelName].associate(db);
      addModelPagination(db[modelName]);
    }
  });
~~~~

This package was inspired by https://github.com/Kaltsoon/sequelize-cursor-pagination

---
_Source: https://npm.io/package/oly-sqlize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
