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

djorm-db-gcp-datastore

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djorm-db-gcp-datastore - npm Package Compare versions

Comparing version 0.1.5-alpha.10 to 0.1.5-alpha.11

22

DatastoreSelectFormatter.js
const { DatastoreFormatterBase } = require('./DatastoreFormatterBase')
const { Count } = require('djorm/db/Count')

@@ -7,3 +8,22 @@ class DatastoreSelectFormatter extends DatastoreFormatterBase {

const [query, modifiers] = this.createModifiers(qs)
return modifiers.reduce((aggr, modifier) => modifier(qs, aggr), query)
const dsQuery = modifiers.reduce(
(aggr, modifier) => modifier(qs, aggr),
query
)
const count = qs.props.selection.find(item => item instanceof Count)
// @HACK: Assume this is count query and add dummy postprocessor
if (count) {
const dsq = dsQuery
.select('__key__')
.limit(-1)
.offset(0)
dsq.postprocess = results => [
{
__djorm_cnt: results.length
}
]
return dsq
}
return dsQuery
}

@@ -10,0 +30,0 @@ }

7

index.js

@@ -38,5 +38,6 @@ const { Database } = require('djorm/db/Database')

async queryDb (query) {
const [result] = await this.db.runQuery(query())
return result
async queryDb (configureQuery) {
const query = configureQuery()
const [result] = await this.db.runQuery(query)
return query.postprocess ? query.postprocess(result) : result
}

@@ -43,0 +44,0 @@

{
"name": "djorm-db-gcp-datastore",
"version": "0.1.5-alpha.10",
"version": "0.1.5-alpha.11",
"description": "Datastore bindings for djorm",

@@ -31,3 +31,3 @@ "author": "Pavel Žák <pavel@zak.global>",

},
"gitHead": "b062395336964f9ee176f6ccadb0ac27f2b0f521"
"gitHead": "30ac54fa76fcb4ddb229f872d285e7ab3f004c4c"
}
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