npm.io
1.0.9 • Published 9 years ago

lambdadb

Licence
ISC
Version
1.0.9
Deps
3
Vulns
1
Weekly
0
DeprecatedThis package is deprecated

LambdaDB Client

This package is a client for the LambdaDB server.

Secret Token

Get your secret token by running lambdadb info in your terminal:

secretToken

Examples

Insert into a table
var lambdaDB = require('lambdadb')({
    host: 'localhost',
    secretToken: 'my secret token',
    database: 'databasename'
})

lambdaDB.table('users').insert({
    username: 'user',
    password: 'pass'
}).then(function(response) {
    console.log(response.data) // => logging the trace of the SQL query 
})
Raw SQL queries
var lambdaDB = require('lambdadb')({
    host: 'localhost',
    secretToken: 'my secret token',
    database: 'databasename'
})

lambdaDB.raw('SELECT * FROM users').then(function(response) {
    console.log(response.data) // => logging the rows
})
Describe a table
var lambdaDB = require('lambdadb')({
    host: 'localhost',
    secretToken: 'my secret token',
    database: 'databasename'
})

lambdaDB.table('users').describe().then(function(response) {
    console.log(response.data) // => logging the structure of the database
})