Socket
Book a DemoInstallSign in
Socket

@parch-js/orm

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parch-js/orm

ORM for parch providing record DSL

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

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.

Keywords

parch

FAQs

Package last updated on 11 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts