Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Releases: PhilWaldmann/openrecord

fixes a context bug with relations

12 Nov 12:21
Compare
Choose a tag to compare
v1.6.2

fixes a context bug with relations

LDAP Support!!

06 Nov 15:01
Compare
Choose a tag to compare

Openrecord is able to talk to your ldap server.
Full activedirectory support will follow soon!

Some knex bugfixes

28 Oct 17:10
Compare
Choose a tag to compare
v1.5.4

some small bugfixes + additional tests

Bugfixes

20 Oct 12:19
Compare
Choose a tag to compare
v1.5.3

bugfixes

Time Bugfix

17 Oct 09:59
Compare
Choose a tag to compare

Fixes a bug in the time datatype of postgres and mysql

knex Update + cross-store relations

13 Oct 17:25
Compare
Choose a tag to compare

Cross-Store relations by example:

store1 = new Store({
  //...config...
  name: "Store1"
});

store2 = new Store({
  //...config...
  name: 'Store2'
});

store1.Model('User', function(){
  this.belongsTo('user', {store: 'Store2', primary_key:'id'});
});

store2.Model('User', function(){

});

var User = store1.model('User');
User.include('user').exec(....)

More bugfixes

13 Aug 13:30
Compare
Choose a tag to compare
v1.4.5

bump version

Lot of bugfixes

01 Aug 13:02
Compare
Choose a tag to compare
v1.4.4

postgres hstore bugfix

Bugfixes, Converter, Temporary Definition

30 Jul 12:11
Compare
Choose a tag to compare

Convert

It's now possible to convert every input, output, read or write value

example model definition:

module.exports = function(){
  this.convertOutput('login', function(value){
    return value + '-foo'; //append '-foo' to the login attribute.
  });
}

The convertOutput method will be called on every toJson() call.
Only the resulting json object will have the converted value.

There are currently 4 convert methods available:

  • convertInput: will be called on set() or on assignments records.login = 'phil';
  • convertOutput: will be called on toJson()
  • convertRead: will be called while reading data from the database
  • convertWrite: will be called while writing to the database

Temporary Definition

The method temporaryDefinition() will create a temporary definition object for you.
here is an example:

module.exports = function(){
  this.scope('combine_name', function(){
    this.temporaryDefinition()
    .attribute('full_name', String)
    .convertOutput('full_name', function(){
      //we don't need the value here
      return this.first_name + ' ' + this.last_name;
    });
  });
}

in the above example we create a scope combine_name. Only if you call the scope:
YourModel.combine_name().exec(...)
you will receive the extra field full_name on every record.
If you just call
YourModel.exec(...)
you won't receive the full_name attribute.

Now you could add/change Hooks, validations, converters, attributes and more - temporarily.

logger config option + bugfixes

23 Jul 15:21
Compare
Choose a tag to compare

It's now possible to define your own logger.

Just set the logger option to the logger class in your store config.