dataless
A javascript ORM with multiple adapters that aims to provide data access in browsers.
Features
- Support multiple databases adapter
- REST adapter
- Local In-Memory adapter (WIP)
- Entity abstraction layer with basic query operations
- Support model definition
- Basic definition
- Define table
- Primary Key
- Date fields
- Field to type casting
- Basic Create / Read / Update / Delete operations
- Model event hooks
- Getter and Setter mutators
- Define model relationships
- BelongsTo
- HasMany
- HasOne
- BelongsToMany
- Perform advanced query on a relationship on a model
- Eager load relationships
- Call remote functions defined on remote entity (rest endpoint or db functions)
- Basic definition
- DOCS D:
Code example
// first import needed classes // configure your connectionDatabaseManager;DatabaseManager; // define your model // provide a table _table = 'auth/users'; // a mutator { return this_attributes'name' + ' ' + this_attributes'surname'; } // define your model // provide a table _table = 'auth/profiles'; // provide a connection _connection = 'default'; // setup a relation { return this; } // Another model in memory store _table = 'settings'; _connection = 'memory'; // the app function will be executed once the db is ready{ // search profiles var theProfile = await Profile; var profiles = await Profile; console; console; // create a new record with some data var profile = ; profile; profile; await profile; // update it profile; await profile; // access it console; // destroy it await profile; // create a new record in the memory connection var setting = ; setting; setting; await setting; // dump the memory store console;} // connect all the db and let it fly! :DPromiseallDatabaseManager DatabaseManager;