AntonNiklasson / eslint-plugin-knex

Lint rule(s) for Knex.js
9 stars 8 forks source link

feat: make rawStatements user-configurable #19

Open Sekhmet opened 2 years ago

Sekhmet commented 2 years ago

In some cases knex might be used through a helper function that uses different name than any of predefined ones (raw, joinRaw, whereRaw).

In this case allowing users to add different function names can be useful.

For example

db.wrapQuery = (query) => (...args) => knex.query(query, args)

const getUserById = db.wrapQuery('select * from ' + table + ' where id = ?')