Socket
Socket
Sign inDemoInstall

@sap/cds-sqlite

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds-sqlite - npm Package Compare versions

Comparing version 1.18.1 to 1.21.0

30

CHANGELOG.md

@@ -9,2 +9,32 @@ # Changelog

## Version 1.21.0 - 2019-12-10
### Changed
- Pool options always set to default
## Version 1.20.1 - 2019-11-29
### Changed
- Updated version of @sap/cds-sql to 1.20.1
## Version 1.20.0 - 2019-11-19
### Added
- Conversion of hana's `seconds_between` function to `strftime` for sqlite
## Version 1.19.1 - 2019-10-30
### Changed
- Updated version of @sap/cds-sql to 1.19.1
## Version 1.19.0 - 2019-10-29
### Removed
- `npm-shrinkwrap.json`
## Version 1.18.1 - 2019-10-16

@@ -11,0 +41,0 @@

16

lib/client/Client.js

@@ -180,3 +180,3 @@ const { Database } = require('sqlite3')

if (!query.SELECT && (typeof query !== 'string' || !query.trim().startsWith('SELECT'))) {
throw new Error(`Cannot stream from HANA. Invalid query provided: ${JSON.stringify(query)}`)
throw new Error(`Cannot stream from sqlite. Invalid query provided: ${JSON.stringify(query)}`)
}

@@ -384,8 +384,10 @@

/* istanbul ignore next */
return selectDeepUpdateData(this._csn && this._csn.definitions, cqn, this._execute.bind(this)).then(selectData => {
return this.processNestedCQNs(
createDeepUpdateCQNs(this._csn && this._csn.definitions, cqn, selectData),
this._execute.bind(this)
)
})
return selectDeepUpdateData(this._csn && this._csn.definitions, cqn, this._execute.bind(this), this._context).then(
selectData => {
return this.processNestedCQNs(
createDeepUpdateCQNs(this._csn && this._csn.definitions, cqn, selectData),
this._execute.bind(this)
)
}
)
}

@@ -392,0 +394,0 @@

@@ -12,19 +12,5 @@ const _validateFails = option => {

const _validatePool = options => {
if (options.pool.min > options.pool.max) {
if (!isNaN(options.pool.min) && !isNaN(options.pool.max) && options.pool.min > options.pool.max) {
_validateFails('"options.pool.min" is bigger than "options.pool.max"')
}
if (options.credentials.database === ':memory:') {
if (options.pool.max !== 1) {
_validateFails('"options.pool.max" in :memory: should equal 1')
}
if (options.pool.evictionRunIntervalMillis !== 0) {
_validateFails('"options.pool.evictionRunIntervalMillis" in :memory: should equal 0')
}
if (options.pool.idleTimeoutMillisForPools !== 0) {
_validateFails('"options.pool.idleTimeoutMillisForPools" in :memory: should equal 0')
}
}
}

@@ -46,15 +32,15 @@

options.credentials = options.credentials || {}
options.credentials.database = options.credentials.database || options.database || options.host || options.url || options.credentials.url
options.credentials.database =
options.credentials.database || options.database || options.host || options.url || options.credentials.url
options.pool.min = options.pool.min || 1
options.pool.max = options.pool.max || (options.credentials.database === ':memory:' ? 1 : 10)
options.pool.evictionRunIntervalMillis =
options.pool.evictionRunIntervalMillis || (options.credentials.database === ':memory:' ? 0 : 10000)
options.pool.idleTimeoutMillisForPools =
options.pool.idleTimeoutMillisForPools || (options.credentials.database === ':memory:' ? 0 : 60000)
_validatePool(options)
options.pool.min = 1
options.pool.max = 1
options.pool.evictionRunIntervalMillis = 0
options.pool.idleTimeoutMillisForPools = 0
_validateDatabase(options.credentials.database)
_validatePool(options)
}
module.exports = options

@@ -48,2 +48,4 @@ const FunctionBuilder = require('@sap/cds-sql').builder.FunctionBuilder

this._standardFunction(functionName, args)
} else if (functionName === 'seconds_between') {
this._secondsBetweenFunction(args)
} else {

@@ -135,2 +137,29 @@ super._handleFunction()

_val (val) {
this._outputObj.sql.push('?')
this._outputObj.values.push(val)
}
_ref (ref) {
this._outputObj.sql.push(new this.ReferenceBuilder(ref, this._options, this._csn).build().sql)
}
_secondsBetweenFunction (args) {
this._outputObj.sql.push('strftime(?,')
this._outputObj.values.push('%s')
if (args[1].val) {
this._val(args[1].val)
} else {
this._ref(args[1])
}
this._outputObj.sql.push(') - strftime(?,')
this._outputObj.values.push('%s')
if (args[0].val) {
this._val(args[0].val)
} else {
this._ref(args[0])
}
this._outputObj.sql.push(')')
}
_timeFunction (functionName, args) {

@@ -137,0 +166,0 @@ this._outputObj.sql.push('strftime(')

@@ -24,4 +24,6 @@ const SelectBuilder = require('@sap/cds-sql').builder.SelectBuilder

}
_forUpdate () {}
}
module.exports = CustomSelectBuilder

@@ -1,1 +0,1 @@

{"bundleDependencies":false,"dependencies":{"@sap/cds-sql":"1.18.1"},"deprecated":false,"description":"Driver package for access to sqlite database, including setting up the client, configuring all the necessary options to initiate the connection and handling database specifics so that they can be processed on our end.","engines":{"node":">= 8.9.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"{lib,test}/**/*.js":["prettier-standard","standard --fix","git add"]},"main":"lib/index.js","name":"@sap/cds-sqlite","version":"1.18.1","license":"SEE LICENSE IN developer-license-3.1.txt"}
{"bundleDependencies":false,"dependencies":{"@sap/cds-sql":"1.21.0"},"deprecated":false,"description":"Driver package for access to sqlite database, including setting up the client, configuring all the necessary options to initiate the connection and handling database specifics so that they can be processed on our end.","engines":{"node":">= 8.9.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"{lib,test}/**/*.js":["prettier-standard","standard --fix","git add"]},"main":"lib/index.js","name":"@sap/cds-sqlite","version":"1.21.0","license":"SEE LICENSE IN developer-license-3.1.txt"}

Sorry, the diff of this file is not supported yet

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