- Documentation
- Quickstart
- Introduction
- Importing thinky
- Schemas
- Relations
- Virtuals
- Feeds
- FAQ
- API
-
- Model
- - getTableName
- - define
- - defineStatic
- - ensureIndex
- - hasOne
- - belongsTo
- - hasMany
- - hasAndBelongsToMany
- - save
- - pre
- - post
- - Query's methods
- - EventEmitter's methods
- - EventEmitter's methods
for documents
- Document
- - getModel
- - merge
- - validate
- - validateAll
- - save
- - saveAll
- - getOldValue
- - isSaved
- - setSaved
- - delete
- - deleteAll
- - purge
- - addRelation
- - removeRelation
- - getFeed
- - closeFeed
- - EventEmitter's methods
- Query
- - getJoin
- - addRelation
- - removeRelation
- - run
- - execute
- - ReQL methods
- - Overwritten ReQL methods
Introduction
What is thinky?
thinky
is a light Node.js ORM for RethinkDB.
It wraps the rethinkdbdash driver and provides some extra features, like models, easy joins etc.
The goal of thinky
is to make retrieving/saving/deleting joined documents from RethinkDB as
easy as possible.
What are the advantages of using thinky?
- Less code to write
- It uses
rethinkdbdash
so you do not have to deal with connections. - It provides Models and handles joins in a nice and efficient way:
- saving joined documents can be done with a single command:
saveAll
. - retrieving joined documents can be done with a single command:
getJoin
. - deleting joined documents can be done with a single command:
deleteAll
.
- saving joined documents can be done with a single command:
- Tables are automatically created.
- Indexes for joins are automatically created.
- It uses
- Fewer headaches
- It validates documents before saving them, which prevents you from saving incoherent data.
- You do not have to remember the name of all your foreign keys.
- Cursors are automatically coerced to arrays by default.
- Easy to learn
- Chainable commands like in the driver.
- All the commands available in the driver are also available with
thinky
.
What are the disadvantages of using thinky?
Nothing that I can think of. It is basically sugar on top of the driver.
Awesome, where should I start?
Take a look at:
- The quickstart
- The examples on GitHub
- The API documentation