Package Exports
- sql
- sql/lib/node
- sql/lib/node/index
- sql/lib/node/query
- sql/lib/table
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sql) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-sql
sql string builder for node
examples
//require the module
var sql = require('sql');
//first we define our table
var user = sql.define({
name: 'user',
columns: ['id', 'email', 'lastLogin']
});
//now we make a query
var usersWhoLoggedInBeforeToday = user.select(user.id, user.email).from(user).where(user.lastLogin.lt(new Date()));
console.log(usersWhoLoggedInBeforeToday.toQuery());
// { text: 'SELECT user.'id', user.'email' FROM user WHERE user.'lastLogin' > $1', values: ['2011-01-1'] }
I know this is a cop-out for now, but for more in-depth examples view test/dialect-tests.js
help!
I need help with a mysql and sqlite syntax. Even if you don't want to contribute code, I could still use some failing tests I can work towards. You see, I don't really know mysql or sqlite syntax very well and don't use either database much. If you'd like to contribute, please message me on github. I'll give you commit access, and we'll be off to the races.
##license MIT