8000 GitHub - compactd/slothdb at v1.7.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

compactd/slothdb

Repository files navigation

SlothDB

styled with prettier Greenkeeper badge Travis Coveralls

A typescript ORM that uses annotation and classes to describe the database

Philosophy

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 scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)

About

ORM for PouchDB only built in typescript

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0