# sequelazy

> Add lazy execution callbacks to sequelize

Latest version **1.0.3** (published 2015-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install sequelazy
pnpm add sequelazy
yarn add sequelazy
bun add sequelazy
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2015-04-27 |
| First published | 2014-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kory Nunn |
| Maintainers | korynunn |
| Keywords | sequelize, lazy, kgo, customulize |

## Links

- npm: https://www.npmjs.com/package/sequelazy
- Repository: https://github.com/korynunn/sequelazy
- Issues: https://github.com/korynunn/sequelazy/issues
- npm.io page: https://npm.io/package/sequelazy

## Dependencies (1)

- [customulize](https://npm.io/package/customulize.md) ^1.0.2

## Recent versions

- 1.0.3 (latest) — 2015-04-27
- 1.0.2 — 2014-07-07
- 1.0.1 — 2014-07-07
- 1.0.0 — 2014-07-04

## README

#sequelazy

Adds lazy execution of queries to sequelize via [customulize](https://www.npmjs.org/package/customulize)

##Installation

    npm install sequelazy

##usage

    var sequelazy = require('sequelazy'),

    // define your sequelize models
    var models = {
        Account: require('./account')
    };

    // call function over them
    sequelazy(models);

    // now you can execute queries lazily
    var executeQuery = models.Account.lazy.find({ where: { id: 1} });

    // later...
    executeQuery(function(error, account) {
        if (error) {
            // error logic
        }
        account.name = 'John';
        account.cps.save(function(error, account) {

        });
    });

##kgo
When using [kgo](https://www.npmjs.org/package/kgo) this is especially convenient.

    kgo
    ('account', Account.lazy.find({where: {id: 1}}))
    ('update', ['account'], function(account, done) {
        account.name = 'John';
        account.cps.save(done);
    })
    // etc, etc, etc

Pull requests welcome with passing tests.

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