Miss any of our Open RFC calls?Watch the recordings here! »

@loke/mysql-orm

1.13.1 • Public • Published

loke-mysql-orm

NPM Version Build Status Coverage Status NPM Downloads License

Install

npm install --save loke-mysql-orm

Example

var db = require('loke-mysql-orm').create('mysql://root@localhost/demo');
var petRepository = db.table('Pets', {
  name: { type: String, defaultValue: () => 'Untitled' },
  description: db.Text
});
var 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

Keywords

Install

npm i @loke/mysql-orm

DownloadsWeekly Downloads

263

Version

1.13.1

License

MIT

Last publish

Collaborators

  • avatar