Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getLogs () {
return r
.db(SYSTEM_DB)
.table('logs')
.limit(10)
.coerceTo('array')
.run(connection())
}
const serverList = () => {
return r
.db('rethinkdb')
.table('stats')
.filter(row =>
row('id')
.nth(0)
.eq('server')
)
.coerceTo('array')
}
const addDatabase = ({ name }) => {
return r
.db(SYSTEM_DB)
.table('db_config')
.insert({ name })
.run(connection())
}
const deleteTables = tablesToDelete => {
return r
.db(SYSTEM_DB)
.table('table_config')
.filter(table => {
return r.expr(tablesToDelete).contains({
db: table('db'),
name: table('name')
})
})
.delete({ returnChanges: true })
.run(connection())
}
const sysTable = name => r.db(SYSTEM_DB).table(name)