Created
August 4, 2016 05:31
-
-
Save pospi/30718c23adf7cfce8f53902e9e2ca3de to your computer and use it in GitHub Desktop.
Curryable function to load `r.table` objects for horizon.io collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const r = require('rethinkdb'); | |
const { curry } = require('ramda'); | |
module.exports = curry(function* (rdbConn, projectName, collectionName) { | |
const table = yield r.db(`${projectName}_internal`).table('collections').get(collectionName).getField('table').run(rdbConn); | |
return r.db(projectName).table(table); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment