Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-jpa

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-jpa - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

4

package.json
{
"name": "js-jpa",
"version": "0.0.23",
"version": "0.0.24",
"description": "jpa for node",

@@ -22,2 +22,2 @@ "author": "stone",

}
}
}

@@ -45,2 +45,6 @@ const SqlGenerator = require('../../jpa/SqlGenerator')

getSelect(schema, where, pageRequest) {
let fields = '*'
if (pageRequest && pageRequest.fields) {
fields = pageRequest.fields.join(',')
}
let order = (pageRequest && pageRequest.orders) ? this.getOrders(pageRequest.orders) : false

@@ -60,3 +64,3 @@ let sql = `FROM \`${schema.name}\``

sql = `SELECT \`${primaryKey}\` ${sql} LIMIT ${pageRequest.page * pageRequest.size}, ${pageRequest.size}`
sql = `SELECT * FROM \`${schema.name}\` WHERE \`${primaryKey}\` IN (SELECT \`${primaryKey}\` FROM (${sql}) AS tt)`
sql = `SELECT ${fields} FROM \`${schema.name}\` WHERE \`${primaryKey}\` IN (SELECT \`${primaryKey}\` FROM (${sql}) AS tt)`
if (order) {

@@ -66,3 +70,3 @@ sql += ' ORDER BY ' + order

} else {
sql = `SELECT * ${sql}`
sql = `SELECT ${fields} ${sql}`
}

@@ -69,0 +73,0 @@ return sql

@@ -53,3 +53,4 @@ export function newDataSource(config: JpaConfig): Promise<DataSource>

size?: number,
orders?: PageOrder[]
orders?: PageOrder[],
fields?: string[]
}

@@ -56,0 +57,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc