1.0.9 • Published 7 years ago
lambdadb v1.0.9
LambdaDB Client
This package is a client for the LambdaDB server.
Secret Token
Get your secret token by running lambdadb info
in your terminal:
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
})