Have ideas to improve npm?Join in the discussion! »

sql-operandcount

0.0.6 • Public • Published

sql-operandcount

NPM

Defines the number of operands used with an SQL operator in Node.js.

var sqlOperandCount = require('sql-operandcount');
sqlOperandCount.get('+');       // 2
sqlOperandCount.get('BETWEEN'); // 3

Arithmetic operators

Operator Operand Count Description
+ 2 Add
- 2 Subtract
* 2 Multiply
/ 2 Divide
% 2 Modulo

Bitwise operators

Operator Operand Count Description
& 2 Bitwise AND
| 2 Bitwise OR
^ 2 Bitwise exclusive OR

Comparison operators

Operator Operand Count Description
= 2 Equal to
> 2 Greater than
< 2 Less than
>= 2 Greater than or equal to
<= 2 Less than or equal to
<> 2 Not equal to

Compound operators

Operator Operand Count Description
+= 2 Add equals
-= 2 Subtract equals
*= 2 Multiply equals
/= 2 Divide equals
%= 2 Modulo equals
&= 2 Bitwise AND equals
^= 2 Bitwise exclusive OR equals
|= 2 Bitwise OR equals

Logical operators

Operator Operand Count Description
ALL 2 TRUE if all of the subquery values meet the condition
AND 2 TRUE if all the conditions separated by AND is TRUE
ANY 2 TRUE if any of the subquery values meet the condition
BETWEEN 3 TRUE if the operand is within the range of comparisons
EXISTS 1 TRUE if the subquery returns one or more records
IN 2 TRUE if the operand is equal to one of a list of expressions
LIKE 2 TRUE if the operand matches a pattern
NOT 1 Displays a record if the condition(s) is NOT TRUE
OR 2 TRUE if any of the conditions separated by OR is TRUE
SOME 2 TRUE if any of the subquery values meet the condition

Install

npm i sql-operandcount

DownloadsWeekly Downloads

6

Version

0.0.6

License

MIT

Last publish

Collaborators

  • avatar