@foxify/odin

Active Record Model

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@foxify/odin
20110.10.02 years ago4 years agoMinified + gzip package size for @foxify/odin in KB

Readme

Odin
Odin is an implementation of Active Record pattern in TypeScript.
NPM Version Node Version TypeScript Version Tested With Jest Pull Requests License Build Status Coverage Status Package Quality Dependencies Status NPM Total Downloads NPM Monthly Downloads Open Issues Closed Issues known vulnerabilities Github Stars Github Forks

Table of Content

Installation

Before installing, download and install Node.js. Node.js 8 or higher is required.
npm i -s @foxify/odin

Usage

const Odin = require("@foxify/odin");

const { Types } = Odin;

class User extends Odin {
}

User.schema = {
  email: Types.String.email.required,
  name: {
    first: Types.String.min(3).required,
    last: Types.String.min(3),
  }
};

Features

  1. Written in ES6
  2. TypeScript ready
  3. Active Record pattern
  4. Schema validation
  5. GraphQL Schema generator (based on model schema)
  6. JSON Schema generator (based on model schema)

TODO (RoadMap to version 1.0.0)

  • x Schema validation
  • Model
- Hooks
- [x] `create`
- [ ] `update`
- [ ] `delete`
- [ ] `restore`
- Relationships
- [x] `embedMany`
- [x] `hasMany`
- [x] `hasOne`
- [ ] `hasManyThrough`
- [ ] `hasOneThrough`
- [ ] `Polymorphic`
  - [x] `morphMany`
  - [x] `morphOne`
  - [ ] `morphTo`
  - [ ] `morphManyThrough`
  - [ ] `morphOneThrough`
  - [ ] `morphToThrough`
- [x] CRUD operations
  - [x] Create operation
  - [x] Read operation
  - [x] Update operation
  - [x] Delete operation
- x GraphQL support - x JSON Schema support
  • Migrations
  • Seeding
  • Tests

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Changelog

See the CHANGELOG.md file for details

Authors


See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Support

If my work helps you, please consider
Buy Me A Coffee Become A Patron