@mrnafisia/type-query
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -52,5 +52,8 @@ "use strict"; | ||
// distinct | ||
if (distinct) { | ||
if (distinct === true) { | ||
tokens.push('DISTINCT'); | ||
} | ||
else if (Array.isArray(distinct)) { | ||
tokens.push("DISTINCT ON ( ".concat(distinct.map(function (column) { return resolveColumn(table, column, false); }).join(', '), " )")); | ||
} | ||
// select | ||
@@ -329,5 +332,13 @@ var resolvedReturning = resolveReturning(function (column) { return ({ type: table.columns[column].type, title: table.columns[column].title }); }, _returning, params.length + 1, ignoreInReturning); | ||
// distinct | ||
if (distinct) { | ||
if (distinct === true) { | ||
tokens.push('DISTINCT'); | ||
} | ||
else if (Array.isArray(distinct)) { | ||
tokens.push("DISTINCT ON ( ".concat(distinct | ||
.map(function (column) { | ||
var _a = getTableDataOfJoinSelectColumn(allTables, column), table = _a.table, alias = _a.alias; | ||
return resolveColumn(table, column.substring((alias + '_').length), true, alias); | ||
}) | ||
.join(', '), " )")); | ||
} | ||
// select | ||
@@ -334,0 +345,0 @@ var resolvedReturning = resolveReturning(function (column) { |
{ | ||
"name": "@mrnafisia/type-query", | ||
"version": "1.2.6", | ||
"description": "mini-orm with full type support for postgres.", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "jest ./tests" | ||
}, | ||
"keywords": [ | ||
"orm", | ||
"query-builder", | ||
"postgres", | ||
"sql", | ||
"type-safe" | ||
], | ||
"repository": "https://github.com/MRNafisiA/type-query.git", | ||
"author": "MRNafisiA <mnafisiasl@gmail.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "^29.5.2", | ||
"@types/lodash": "^4.14.195", | ||
"@types/node": "^20.2.5", | ||
"@types/pg": "^8.10.1", | ||
"jest": "^29.5.0", | ||
"prettier": "^2.8.8", | ||
"ts-jest": "^29.1.0", | ||
"typescript": "^4.9.5" | ||
}, | ||
"dependencies": { | ||
"decimal.js": "^10.4.3", | ||
"lodash": "^4.17.21", | ||
"never-catch": "^1.0.9", | ||
"pg": "^8.11.0" | ||
} | ||
"name": "@mrnafisia/type-query", | ||
"version": "1.2.7", | ||
"description": "mini-orm with full type support for postgres.", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "jest ./tests" | ||
}, | ||
"keywords": [ | ||
"orm", | ||
"query-builder", | ||
"postgres", | ||
"sql", | ||
"type-safe" | ||
], | ||
"repository": "https://github.com/MRNafisiA/type-query.git", | ||
"author": "MRNafisiA <mnafisiasl@gmail.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "^29.5.2", | ||
"@types/lodash": "^4.14.195", | ||
"@types/node": "^20.2.5", | ||
"@types/pg": "^8.10.1", | ||
"jest": "^29.5.0", | ||
"prettier": "^2.8.8", | ||
"ts-jest": "^29.1.0", | ||
"typescript": "^4.9.5" | ||
}, | ||
"dependencies": { | ||
"decimal.js": "^10.4.3", | ||
"lodash": "^4.17.21", | ||
"never-catch": "^1.0.9", | ||
"pg": "^8.11.0" | ||
} | ||
} |
# type-query | ||
SQL Query Builder written in TypeScript |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
591988
9053
4