Meadow
A Javascript Data Broker.
Who doesn't love writing the same code over and over again? Good question. Anybody who doesn't probably wants something to do simple data access stuff. And some of the complicated interactions as well. Meadow aims to provide a simple “magic where you want it, programmability where you don't” pattern.
Install
$ npm install meadow
Because meadow requires the fable library, you will also need to install that dependency:
$ npm install fable
Quick Start
It is pretty easy to perform CRUD access on your database. And facilities are there to go crazy with custom queries and stored procedures.
var databaseSettings = {
MySQL:
{
Server: "localhost",
Port: 3306,
User: "root",
Password: "",
Database: "sales_data",
ConnectionPoolLimit: 20
}
};
var fable = require('fable').new();
var meadow = require('meadow').new(fable, 'Customers')
.setProvider('MySQL')
.setDefaultIdentifier('customerID');
var queryDescription = meadow.query.addFilter('customerID', 17);
meadow.doRead(queryDescription,
function(error, query, customer)
{
if (error)
{
return console.log('Error querying customer data: '+error);
}
console.log('Found customer ID '+customer.customerID+' who is named '+customer.name);
}
);