ediket / nothinkdb Goto Github PK
View Code? Open in Web Editor NEWFunctional toolkit for rethinkdb.
Functional toolkit for rethinkdb.
When running the example in the readme as-is, I see the following error:
ValidationError: {
"table": "user",
"tableName" [1]: -- missing --
}
ok... after changing table
to tableName
, the error disappears but nothing else happens (I'm expecting to see the newly created users in the console).
The example from rethinkdb works fine.
[email protected]: Use uuid module instead
Could we switch from node-uuid
to uuid
without issue?
like this.
Joi.string().meta({ unique: true })
Used in update
, create
Note that empty strings are not allowed by default and must be enabled with allow('').
hasOne
belongsTo
hasMany
belongsToMany
Table
Table#create
and Table#attempt
are duplicate.Table#insert
must be accompanied by Table#create
? Schema that is passed in the constructor is only good for Table#create
where Table#insert
is just a raw rethinkdb insert. Table#insert
should call Table#create
with schema before inserting in the database.// before
bar: hasOne(fooTable.linkedBy(barTable, 'fooId'))
bar: belongsTo(fooTable.linkTo(barTable, 'barId'))
bars: hasMany(fooTable.linkedBy(barTable, 'fooId'))
// after
bar: hasOne(barTable, 'fooId')
bar: belongsTo(barTable, 'barId')
bars: hasMany(barTable, 'fooId')
Table#createRelation
has inconsistent spec.// before
fooTable.createRelation('bar', foo.id, bar.id)
// after
fooTable.createRelation(foo.id, 'bar', bar)
Table#createRelation
should accept other object instead other.id. Table#foreignKey can be any other field than pk, and for Table#createRelation
of belongsTo
, right.table.get(otherPk)
must be fetched with foreignKey that is not necessarily pk.Table#withJoin
is not tested with relations as object. I'm not even sure what it does.apply = query => query;
query = r.branch(
row(right.field),
query.getAll(row(right.field), { index: left.field }),
r.expr([]),
);
Code still works with apply and branch.
create Environment
class.
const env = new Environment();
const fooTable = env.createTable({ ... });
await env.sync() // sync all tables
env.getTable('foos'); // same as fooTable
env.getTableList('foos'); // [...]
https://github.com/ediket/nothinkdb/blob/master/src/__tests__/Table-test.js#L252
syncTable is used nowhere in the application or test. Is this necessary?
They are quite similar but the second offer much more options and is developped by someone on the RethinkDB team.
Could it be possible to use this instead?
Now, Table.sync & Environment.sync receive connection as argument.
Change that functions return query, For it could be used with another ecosystem like rethinkdb-pool.
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.