@imatic/pgqb
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -53,2 +53,3 @@ import * as qb from './qb'; | ||
as: (expr1: qb.Expr, expr2: qb.Expr) => qb.Expr; | ||
like: (expr1: qb.Expr, expr2: qb.Expr) => qb.Expr; | ||
and: (...exprs: qb.Expr[]) => qb.Expr; | ||
@@ -55,0 +56,0 @@ or: (...exprs: qb.Expr[]) => qb.Expr; |
@@ -159,2 +159,3 @@ "use strict"; | ||
as: binaryExprHandler('as'), | ||
like: binaryExprHandler('like'), | ||
and: (...exprs) => ['and', ...exprs], | ||
@@ -161,0 +162,0 @@ or: (...exprs) => ['or', ...exprs], |
@@ -11,3 +11,3 @@ export interface InlineParam { | ||
export declare type UnaryOperator = 'null'; | ||
export declare type BinaryOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'as'; | ||
export declare type BinaryOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'as' | 'like'; | ||
export declare type VarOperator = 'and' | 'or' | 'case_when' | 'in'; | ||
@@ -14,0 +14,0 @@ export declare type FunctionCall = ['%', any]; |
@@ -221,2 +221,3 @@ "use strict"; | ||
in: inHandler, | ||
like: binaryOperatorHandler('LIKE'), | ||
}; | ||
@@ -223,0 +224,0 @@ /** |
{ | ||
"name": "@imatic/pgqb", | ||
"version": "0.1.10", | ||
"description": "Functional PostgreSQL query builder", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"repository": "https://github.com/imatic/pgqb.git", | ||
"license": "MIT", | ||
"keywords": [ | ||
"sql", | ||
"query", | ||
"querybuilder", | ||
"postgresql" | ||
], | ||
"dependencies": { | ||
"@types/ramda": "^0.24.3", | ||
"ramda": "^0.24.1", | ||
"sql-template-strings": "^2.2.2", | ||
"typescript": "^2.3.4" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.0.0", | ||
"@types/mocha": "^2.2.41", | ||
"chai": "^4.1.0", | ||
"mocha": "^3.4.2", | ||
"prettier": "^1.4.2", | ||
"ts-node": "^3.0.4", | ||
"tslint": "^5.4.3" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist/", | ||
"build": "yarn run clean && tsc -d", | ||
"prepublish": "yarn run build", | ||
"test": "mocha --require ts-node/register --sort './tests/**/*.ts'", | ||
"test:watch": "mocha --require ts-node/register --sort './tests/**/*.ts' --watch-extensions 'ts' --watch", | ||
"tslint": "tslint --project . --exclude 'dist/**'", | ||
"prettier": "prettier --tab-width 4 --single-quote --trailing-comma 'es5' --no-bracket-spacing --write 'bin/**/*.ts' 'src/**/*.ts' 'tests/**/*.ts'" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
} | ||
} | ||
"name": "@imatic/pgqb", | ||
"version": "0.1.11", | ||
"description": "Functional PostgreSQL query builder", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"repository": "https://github.com/imatic/pgqb.git", | ||
"license": "MIT", | ||
"keywords": ["sql", "query", "querybuilder", "postgresql"], | ||
"dependencies": { | ||
"@types/ramda": "^0.24.3", | ||
"ramda": "^0.24.1", | ||
"sql-template-strings": "^2.2.2", | ||
"typescript": "^2.3.4" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.0.0", | ||
"@types/mocha": "^2.2.41", | ||
"chai": "^4.1.0", | ||
"mocha": "^3.4.2", | ||
"prettier": "^1.4.2", | ||
"ts-node": "^3.0.4", | ||
"tslint": "^5.4.3" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist/", | ||
"build": "yarn run clean && tsc -d", | ||
"prepublish": "yarn run build", | ||
"test": "mocha --require ts-node/register --sort './tests/**/*.ts'", | ||
"test:watch": | ||
"mocha --require ts-node/register --sort './tests/**/*.ts' --watch-extensions 'ts' --watch", | ||
"tslint": "tslint --project . --exclude 'dist/**'", | ||
"prettier": | ||
"prettier --tab-width 4 --single-quote --trailing-comma 'es5' --no-bracket-spacing --write 'bin/**/*.ts' 'src/**/*.ts' 'tests/**/*.ts'" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
} | ||
} |
@@ -187,2 +187,3 @@ import * as qb from './qb'; | ||
as: binaryExprHandler('as'), | ||
like: binaryExprHandler('like'), | ||
and: (...exprs: qb.Expr[]): qb.Expr => ['and', ...exprs] as qb.Expr, | ||
@@ -189,0 +190,0 @@ or: (...exprs: qb.Expr[]): qb.Expr => ['or', ...exprs] as qb.Expr, |
@@ -20,3 +20,11 @@ import * as r from 'ramda'; | ||
export type BinaryOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'as'; | ||
export type BinaryOperator = | ||
| '=' | ||
| '!=' | ||
| '>' | ||
| '>=' | ||
| '<' | ||
| '<=' | ||
| 'as' | ||
| 'like'; | ||
@@ -362,2 +370,3 @@ export type VarOperator = 'and' | 'or' | 'case_when' | 'in'; | ||
in: inHandler, | ||
like: binaryOperatorHandler('LIKE'), | ||
}; | ||
@@ -364,0 +373,0 @@ |
@@ -160,2 +160,3 @@ import {expect} from 'chai'; | ||
h.expr.lte('t1.c', 't2.c'), | ||
h.expr.like('t1.c', h.val.inlineParam('%text%')), | ||
]) | ||
@@ -185,2 +186,3 @@ ), | ||
['<=', 't1.c', 't2.c'], | ||
['like', 't1.c', {ip: '%text%'}], | ||
], | ||
@@ -187,0 +189,0 @@ }, |
@@ -141,2 +141,3 @@ import {expect} from 'chai'; | ||
['<=', 't1.c', 't2.c'], | ||
['like', 't1.c', {ip: '%text%'}], | ||
], | ||
@@ -161,4 +162,5 @@ }, | ||
' "t1"."c" < "t2"."c",' + | ||
' "t1"."c" <= "t2"."c"', | ||
values: [null, 'blue', 'red', 'green', 'red'], | ||
' "t1"."c" <= "t2"."c",' + | ||
` "t1"."c" LIKE $6`, | ||
values: [null, 'blue', 'red', 'green', 'red', '%text%'], | ||
}, | ||
@@ -165,0 +167,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94714
1822