Odin
Odin is an implementation of Active Record pattern in TypeScript.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
- Written in
ES6
TypeScript
readyActive Record
patternSchema
validationGraphQL Schema
generator (based on model schema)JSON Schema
generator (based on model schema)
TODO (RoadMap to version 1.0.0)
- x
Schema
validation - Model
- [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
supportVersioning
We use SemVer for versioning. For the versions available, see the tags on this repository.Changelog
See the CHANGELOG.md file for detailsAuthors
- Ardalan Amini - Core Maintainer - @ardalanamini
See also the list of contributors who participated in this project.