Registry / database / thinky

thinky

JSON →
library2.3.9jsnpmunverified

Thinky is a lightweight Node.js ORM for RethinkDB, version 2.3.9. It provides a schema-based model layer with automatic table creation, validation (string lengths, email format), and relationship methods like belongsTo. Key differentiators: minimalistic API, built-in join support via getJoin(), and promise-based operations. Active but last release was in 2016; community has moved to other RethinkDB ORMs or the rethinkdbdash driver.

npm install thinky
INSTALL
IMPORT
SIG · THINKY
T
thinky
databasejavascriptv2.3.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

thinky
✓ const thinky = require('thinky')();
✗ const thinky = require('thinky');
thinky needs to be invoked as a function (with optional config) to create an instance.
type
✓ const type = require('thinky')().type;
✗ const type = require('thinky').type;
type is accessed from the thinky instance, not the module directly.
r
✓ const r = require('thinky')().r;
✗ const r = require('rethinkdb');
thinky exposes its own reql instance via .r; using the rethinkdb driver directly can cause conflicts.

Shows model creation, validation, relationship definition, and saving/retrieving joined documents.

const thinky = require('thinky')(); const type = thinky.type; const Author = thinky.createModel('Author', { id: type.string(), name: type.string().min(2), email: type.string().email() }); const Post = thinky.createModel('Post', { id: String, title: String, content: String, idAuthor: String }); Post.belongsTo(Author, 'author', 'idAuthor', 'id'); const author = new Author({ name: 'Michel', email: 'orphee@gmail.com' }); const post = new Post({ title: 'Hello World!', content: 'This is an example.' }); post.author = author; post.saveAll().then(result => console.log(result)); Post.get(result.id).getJoin().run().then(doc => console.log(doc));
Debug
Known issues
breakingthinky v2.x requires rethinkdbdash or rethinkdb driver - ensure one is installed
fix
npm install rethinkdbdash or npm install rethinkdb
affects: >=2.0.0
deprecatedThe author has indicated project is in maintenance mode - no new features
fix
Consider migrating to alternatives like thinky-mongo or rethinkdbdash directly
affects: >=2.3.9
gotchaInvoking thinky() without config uses default rethinkdb host/port - ensure RethinkDB is running
fix
Pass config object: thinky({host: 'localhost', port: 28015})
affects: >=2.0.0
gotchagetJoin() only works after saving the document; it does not auto-populate
fix
Always call .getJoin() on retrieved documents after saving
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rethinkdb'
thinky requires rethinkdb driver but it's not installed
fix
npm install rethinkdb (or rethinkdbdash)
TypeError: thinky is not a function
thinky was not invoked with () after require
fix
const thinky = require('thinky')();
Error: type.string is not a function
type accessed from wrong object (module level instead of instance)
fix
const type = require('thinky')().type;
Upgrade
Version history
2.3.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
packagethinky ↗
thinky — npm install thinky · libregistry