Database utils for node.js.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
library
test
.gitignore
.npmignore
main.js
package.json
readme.md

readme.md

DEPRECATED

DEPRECATION NOTICE.
This project is not maintained.

This module does not follow best practice, do not use it.
For researches and arhceologiust only.

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()