# openrecord

> Active record like ORM for nodejs

Latest version **2.11.1** (published 2021-03-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.11.1 |
| Published | 2021-03-08 |
| First published | 2014-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 5 |
| Unpacked size | 580.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Philipp Waldmann |
| Maintainers | philw |
| Keywords | orm, record, sql, sqlite3, postgres, pg, mysql, oracle, graphql, database, activerecord, promise, rest, restify, nested set, ldap, activedirectory, active directory, ad |

## Links

- npm: https://www.npmjs.com/package/openrecord
- Repository: https://github.com/PhilWaldmann/openrecord
- Homepage: https://github.com/PhilWaldmann/openrecord#readme
- Issues: https://github.com/PhilWaldmann/openrecord/issues
- npm.io page: https://npm.io/package/openrecord

## Dependencies (5)

- [knex](https://npm.io/package/knex.md) ^0.21.19
- [debug](https://npm.io/package/debug.md) ^4.3.1
- [date-fns](https://npm.io/package/date-fns.md) ^1.30.1
- [validator](https://npm.io/package/validator.md) ^11.1.0
- [inflection](https://npm.io/package/inflection.md) ~ 1.12.x

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.11.1 (latest) — 2021-03-08
- 2.0.0-rc16 (next) — 2018-04-16
- 1.10.10-node0.10 (node0.10) — 2018-02-05
- 1.5.0-rc2 (rc2) — 2014-09-30
- 1.5.0-rc1 (rc) — 2014-09-30
- 2.11.0 — 2020-08-07
- 2.10.8 — 2020-04-06
- 2.10.6 — 2020-01-27
- 2.10.5 — 2019-12-11
- 2.10.4 — 2019-11-23
- 2.10.2 — 2019-07-11
- 2.10.1 — 2019-06-04
- 2.10.0 — 2019-04-14
- 2.9.3 — 2019-04-14
- 2.9.2 — 2019-02-13
- … 226 more at https://npm.io/package/openrecord/versions

## README

![OpenRecord](docs/logo.png)
==========

[![Build Status](https://travis-ci.org/PhilWaldmann/openrecord.svg?branch=master)](https://travis-ci.org/PhilWaldmann/openrecord)
[![Coverage Status](http://coveralls.io/repos/PhilWaldmann/openrecord/badge.png)](https://coveralls.io/r/PhilWaldmann/openrecord)
[![npm package version](http://badge.fury.io/js/openrecord.png)](https://npmjs.org/package/openrecord)
[![Package Quality](http://npm.packagequality.com/shield/openrecord.svg)](http://packagequality.com/#?package=openrecord)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/PhilWaldmann/openrecord.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/PhilWaldmann/openrecord)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/PhilWaldmann/openrecord.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/PhilWaldmann/openrecord/alerts)

OPENRECORD is an ActiveRecord inspired ORM for nodejs.

Currently it supports the following databases/datastores: SQLite3, MySQL, Postgres, Oracle, REST and LDAP (+ ActiveDirectory)  
If you want to build a GraphQL endpoint for any of these databases, OPENRECORD has some built in features to support you!

As the name imply, it's open and very easy to extend. The whole package was build that way.

It has a lot of features, just take a look at the [docs](https://openrecord.js.org)!

## Usage example

Here is an example how to get a single `post` from an existing sqlite3 file (by primary key).
```js
const Store = require('openrecord/store/sqlite3')

const store = new Store({
  file: './my-posts-db.sqlite3',
  autoLoad: true
})

store.ready(async () => {
  const post = await store.Model('Post').find(1)
  console.log(post)
})
```

You don't have to define your model (optional) and you also don't have to define your model's attributes (optional).  
Take a look at the [docs](https://openrecord.js.org) to get started!

## Contributing

If you've found a bug please report it via the [issues](https://github.com/PhilWaldmann/openrecord/issues) page.  
Before you submit a pull request, please make sure all tests still pass.

---

Sponsored by [digitalbits.at](https://digitalbits.at)

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