outmoded / penseur Goto Github PK
View Code? Open in Web Editor NEWLightweight RethinkDB wrapper
License: Other
Lightweight RethinkDB wrapper
License: Other
Breaking changes:
table.pre('insert', function(items, next) {})
table.pre('update', function(criteria, changes, next) {})
table.pre('replace', function(criteria, changes, next) {})
table.pre('delete', function(criteria, next) {})
Regular increment should be now implemented using the db.increment()
modifier with table.update()
. The next()
method should be used for id allocation needs where the new value of the field is needed.
Ie make empty data optional with establish.
Pass back the changes
array provided by RethinkDB (old_val
/new_val
) on callback from table methods that modify data.
Breaking change because in 5.0.0 it was just being ignored.
Expose the internal Table class and allow external extensions to it used as the default prototype for new table objects.
it('ignores empty object', (done) => {
const db = new Penseur.Db('penseurtest');
const settings = {
penseur_unique_test_a: true, // Test cleanup
test: {
id: 'uuid',
unique: {
path: 'a'
}
}
};
db.establish(settings, (err) => {
expect(err).to.not.exist();
db.test.insert({ id: '1', a: { b: 1, c: [] } }, (err, key) => {
expect(err).to.not.exist();
db.test.update('1', { a: { b: db.unset(), c: db.append(1) } }, (err) => {
expect(err).to.not.exist();
db.test.insert({ id: 2, a: { b: 1 } }, (err) => {
expect(err).to.not.exist();
done();
});
});
});
});
});
Reuse existing database and tables if present.
Changes existing table.count()
interface from:
db.user.count('name', 'fields', callback);
To:
db.user.count(db.fields('name'), callback);
Add a runtime test to make sure a required row is an object before checking for a nest key inside that row.
Support objects in tables
array argument for table
/ establish
in addition to strings:
{
name: 'user',
indexes: [...],
truncate: false,
...
}
Would you take a docs PR?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.