@parch-js/orm
ORM for parch providing record DSL
Last updated 3 years ago by dylanf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @parch-js/orm 
SYNC missed versions from official npm registry.

ORM

Build Status Coverage Status bitHound Overall Score

Simple DSL for accessing data stored in a SQL store.

Installation

npm install --save @parch-js/orm

Usage

Models passed to the constructor must come from a sequelize definition

import ORM from "@parch-js/orm";

const orm = new ORM({
  User: SequelizeDefinedUserModel
});

return orm.findAll("user",
  { firstName: "foo" },
  { attributes: ["firstName"] }
).then(users => {});

return orm.findOne("user", 1,
  { attributes: ["firstName"] }
)then(user => {});

return orm.queryRecord("user",
  { firstName: "foo" },
  { attributes: ["firstName"] }
).then(user => {});

return orm.createRecord("user", { firstName: "bar"}).then(user => {});
return orm.updateRecord("user", 1, { firstName: "baz" }).then(user => {});
return orm.destroyRecord("user", 1).then(() => {});

Read the docs for more in depth usage.

Current Tags

  • 0.0.4                                ...           latest (3 years ago)

4 Versions

  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (17)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |