Quick and easy relational data for your NodeJS apps.

  1. Install the module: 
    npm install springbase
  2. Create your database
  3. Start moving data
  4. It's free!

Easy to use

var springbase = require('springbase');
var conn = new springbase.data.Connection({ 
  application: "1GmTdS2ayPts", 
  username: "<email>", 
  password: "<password>" 
});
var query = conn.getQuery("qryStoreInventoryByZipCode");
query.on("ready", function() {
  var reader = query.execute({ zipCode: 94611 });
  reader.on("row", function(row) {
    console.log("Found store:", row);
  });
});
More examples

Cloud management interface

Create your tables and queries in an HTML5-based cloud IDE. No need to download anything.

SQL query support

Save parameterized queries for rapid recall and manipulation of data.

API reference

Connection class
in springbase.data
Provides access to Springbase objects and data.  Create one of these first, then use it to access tables and queries.
Connection constructor
Requires a config object with the following properties:
  • application The ID of your Springbase database
    (get this from Application->Settings in the IDE)
  • username Your Springbase username (email)
  • password Your Springbase user password
var conn = new springbase.data.Connection({ 
  application: "1GmTdS2ayPts", 
  username: "my-email@gmail.com", 
  password: "mypassword" 
});
getTable
Get a
Table by its name. Second parameter is an optional callback to call when the table is ready to use, or listen for the "ready" event.
var table = conn.getTable("Products"); 
table.on("ready", function() {
  // table is ready to use
});
getQuery
Get a Query by its name. Second parameter is an optional callback to call when the query is ready to use, or listen for the "ready" event.
var query = conn.getQuery("qryStoresByZipCode", function() {
  // query is ready to use
});
Query class
in springbase.data
A saved query, created in the Springbase IDE. Call execute or openReader, optionally with a set of parameters, to run the query. SELECT queries return a Reader with a set of rows.
execute
Run the query. SELECT queries will return a
Reader; listen for the reader's "ready" event, or supply a callback function as the second argument to execute(), to read the results.
Non-SELECT queries (UPDATE, INSERT, and DELETE) return a single number indicating how many rows were affected.
var query = conn.getQuery("qryStoresByZipCode", function() {
  // query is ready to use
});
openReader
Alias for
execute. Only valid for SELECT queries.
Reader class
in springbase.data
A set of data records, loaded from a query or table. Loop through the records using read or get all records as an array using readAll. The number of records is available in the recordCount property.
read
Read the next row. Each row is an object with named properties matching the recordset's column names. For example, if you obtained the Reader by calling
Table.openReader, the row's properties will match the table's column names.
When no more rows are available, returns null.
var query = conn.getQuery("qryStoresByZipCode", function() {
  var reader = query.execute({ zipCode: 94611 });
  reader.on("ready", function() {
    while (var row = reader.read()) {
      console.log("Store hours:", row["Hours"]);
    }
  }
});
readAll
Read all rows and return them in the form of an array. Each element in the returned array is a row identical to the ones returned by
read.
var query = conn.getQuery("qryStoresByZipCode", function() {
  var reader = query.execute({ zipCode: 94611 });
  reader.on("ready", function() {
    reader.readAll().map(function(row) {
      console.log("Store hours:", row["Hours"]);
    });
  }
});
Found a problem with the documentation? Please report it on the issue tracker.