https://github.com/unlight/database-utils
Database utils for node.js.
https://github.com/unlight/database-utils
Last synced: 7 months ago
JSON representation
Database utils for node.js.
- Host: GitHub
- URL: https://github.com/unlight/database-utils
- Owner: unlight
- Created: 2013-05-30T11:20:09.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T20:18:39.000Z (about 9 years ago)
- Last Synced: 2024-04-29T22:07:10.393Z (about 2 years ago)
- Language: JavaScript
- Size: 62.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 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:
```javascript
var sqldriver = new SqlDriver();
var sql = sqldriver
.parameters()
.select("*")
.from("user")
.where("id", 5)
.get();
// select * from user where id = 5
```
Example 2:
```javascript
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()