A typescript ORM that uses annotation and classes to describe the database
Since SlothDB is WIP, this is only a rough sketch
@SlothEntity('author')
class Author extends BaseEntity<{_id: string, name: string}> {
@SlothURI('library', 'author')
_id: string = ''
@SlothField()
name: string = 'Unknown'
}
@SlothEntity('book')
class Book extend BaseEntity<{_id: string, name: string, author: string}> {
@SlothURI('library', 'author', 'name')
_id: string = ''
@SlothField()
name: string = 'Unknown'
@SlothRel({belongsTo: Author})
author: string = 'library/unknown'
}
npm t
: Run test suitenpm start
: Runnpm run build
in watch modenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting and generate coveragenpm run build
: Generate bundles and typings, create docsnpm run lint
: Lints codenpm run commit
: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)