mjs-mysql-builder
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "mjs-mysql-builder", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Mysql query builder", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
@@ -16,3 +16,3 @@ ## Mysql query builder | ||
- field | ||
- Field builder | ||
@@ -36,3 +36,3 @@ ```js | ||
- table | ||
- Schema builder | ||
@@ -54,3 +54,3 @@ ```js | ||
- query | ||
- Query builder | ||
@@ -83,6 +83,21 @@ ```js | ||
```js | ||
(new QueryBuilder('users')) | ||
.select() | ||
.where('age', '>', 5) | ||
.where('name', 'LIKE', '%e%', 'AND') | ||
.build(); | ||
``` | ||
- This converts to | ||
```sql | ||
SELECT * FROM `users` | ||
WHERE `age` > 5 AND `name` LIKE '%e%' | ||
``` | ||
### Models | ||
- Table | ||
- Table builder | ||
@@ -103,7 +118,7 @@ ```js | ||
table.find(id: ConditionType) // -> Promise<?RowType> | ||
table.all() // -> Promise<Array<RowType>> | ||
table.first() // -> Promise<{[string]: any}> | ||
table.last() // -> Promise<{[string]: any}> | ||
table.all(...fields: Array<string>) // -> Promise<Array<RowType>> | ||
table.first(params: ?RowType) // -> Promise<{[string]: any}> | ||
table.last(params: ?RowType) // -> Promise<{[string]: any}> | ||
``` | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42996
33
1098
120