@loke/mysql-orm

MySQL Data Mapper

Stats

StarsIssuesVersionUpdatedCreatedSize
@loke/mysql-orm
022.0.0-beta12 months ago4 years agoMinified + gzip package size for @loke/mysql-orm in KB

Readme

@loke/mysql-orm

NPM Version NPM Downloads License

Install

npm install @loke/mysql-orm

Example

const db = require('@loke/mysql-orm').create('mysql://root@localhost/demo');
const petRepository = db.table('Pets', {
  name: { type: String, defaultValue: () => 'Untitled' },
  description: db.Text
});
const userRepository = db.table('Users', {
  firstName: db.String,
  lastName: db.String,
  pets: [petRepository]
});

userRepository.find({firstName: 'Testing'})
  .then(function (users) {
    users[0].pets[0].description = 'Hello World!';
    // Save changes:
    return userRepository.persist(users[0]);
  });

View Documentation.

Tests

npm test

Coverage

npm run coverage

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.