ORM-like query language to get rid of static endpoints.
import qf from 'query-face';
qf()
.select('*')
.from('posts')
.where('user_id', 2)
.run();
output query object which will be sent to server you desire:
[
{ "$op": "select", "$params": ["*"] },
{ "$op": "from", "$params": ["posts"] },
{ "$op": "where", "$params": ["user_id", "=", 2] }
]
- API documentation
- Tutorials (not started)
Any contributions are welcome.
git clone git@github.com:enginustun/query-face.git
npm ci
Your development must include:
- Requirement codes
- Test codes
All tests must be passed.
npm run test
Finish your development and open a PR.
- Query Generation Core
chainable query structure is ready. - Queries
- select
- insert
- update
- delete
- from
- where / andWhere / orWhere
- whereNot / andWhereNot / orWhereNot
- whereIn / andWhereIn / orWhereIn
- whereNotIn / andWhereNotIn / orWhereNotIn
- whereNull / orWhereNull
- whereNotNull / orWhereNotNull
- whereExists / orWhereExists
- whereNotExists / orWhereNotExists
- whereBetween / orWhereBetween
- whereNotBetween / orWhereNotBetween
- whereRaw
- innerJoin
- leftJoin
- leftOuterJoin
- rightJoin
- rightOuterJoin
- fullOuterJoin
- crossJoin
- on
- onIn / andOnIn / orOnIn
- onNotIn / andOnNotIn / orOnNotIn
- onNull / andOnNull / orOnNull
- onNotNull / andOnNotNull / orOnNotNull
- onExists / andOnExists / orOnExists
- onNotExists / andOnNotExists / orOnNotExists
- onBetween / andOnBetween / orOnBetween
- onNotBetween / andOnNotBetween / orOnNotBetween
- having
- havingIn
- havingNotIn
- havingNull
- havingNotNull
- havingExists
- havingNotExists
- havingBetween
- havingNotBetween
- distinct
- groupBy
- orderBy
- offset
- limit
- returning
- count
- min
- max
- sum
- avg
- truncate
- pluck
- first
- columnInfo
- union
- unionAll
- with
- withRecursive
- withSchema
- run
this is the function that sends query to server.