@akylas/kiss-orm
Advanced tools
Comparing version 2.1.7 to 2.1.8
@@ -26,3 +26,4 @@ import DatabaseInterface from '../Databases/DatabaseInterface'; | ||
}): Promise<Model>; | ||
search({ postfix, where, orderBy, select }?: { | ||
search({ from, postfix, where, orderBy, select }?: { | ||
from?: SqlQuery; | ||
postfix?: SqlQuery; | ||
@@ -29,0 +30,0 @@ where?: SqlQuery; |
@@ -39,3 +39,3 @@ import NotFoundError from '../Errors/NotFoundError'; | ||
} | ||
async search({ postfix, where, orderBy, select } = {}) { | ||
async search({ from, postfix, where, orderBy, select } = {}) { | ||
const filters = []; | ||
@@ -56,5 +56,7 @@ if (this.scope) { | ||
? sql `${select}` : sql `*`; | ||
const fromClause = select | ||
? sql `${from}` : sql `${new QueryIdentifier(this.table)}`; | ||
const results = await this.database.query(sql ` | ||
SELECT ${selectClause} | ||
FROM ${new QueryIdentifier(this.table)} ${postfixClause} | ||
FROM ${fromClause} ${postfixClause} | ||
${whereClause} | ||
@@ -61,0 +63,0 @@ ${orderByClause} |
@@ -8,3 +8,3 @@ { | ||
"author": "Sébastien Caparros", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"engines": { | ||
@@ -11,0 +11,0 @@ "node": ">= 12.0.0" |
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
41048
698