Skip to content

Secure SQL query building library to get rid of static endpoints. Works best with Node.js query-face-node package.

License

Notifications You must be signed in to change notification settings

enginustun/query-face

Repository files navigation

query-face · Build Status npm GitHub

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] }
]

Documentation

Contributing

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.

Roadmap

  • 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.

About

Secure SQL query building library to get rid of static endpoints. Works best with Node.js query-face-node package.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published