Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Database utils for node.js.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
library
test
.gitignore
.npmignore
main.js
package.json
readme.md

readme.md

Collection of libraries to work with database

Query builder

Example 1:

var sqldriver = new SqlDriver();
var sql = sqldriver
    .parameters()
    .select("*")
    .from("user")
    .where("id", 5)
    .get();
// select * from user where id = 5

Example 2:

sql = sqldriver
    .parameters()
    .select("*")
    .from("user")
    .where("id", 5)
    .getQuerySql();

var query = sql[0]; // select * from user where id = ?
var params = sql[1]; // [5]

TODO

  • ORM
  • make new methods getQuerySql() return sql with ? getQueryParameters return place holder as array.
  • [hold, need execute] replace($table = '', $set = null, $where, $checkexisting = false)
  • [hold] history($updatefields = true, $insertfields = false)
  • [hold, need depends on execute] simple getcount
  • [hold, need depends on execute] simple getcountlike
  • [hold, need depends on execute] simple getwhere
  • [hold] limit in update()
  • [hold] in delete()
Something went wrong with that request. Please try again.