Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
datastore-api
Advanced tools
Simplified, more consistent API for Google Cloud Datastore.
Dstore implements a slightly more accessible version of the Google Cloud Datastore: Node.js Client
@google-cloud/datastore is a strange beast: The documentation is auto generated missing some core methods and completely shy of documenting any advanced concepts.
Also the typings are strange and overly broad.
Dstore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to @google-cloud/datastore.
Main differences:
DstoreEntry
.(key, value)
and always returns the complete Key
of the entity being written.@ndb.transactional
feature. This is implemented via node's AsyncLocalStorage.DEBUG='ds:api'
allows you to trace API calls.Find the full documentation here. In there also some of the idiosyncrasies of using the Datastore are explained.
See the API documentation for Details, Github for source.
get_entity_group_version()
/ getEntityGroupVersion()
API has been retired. You can still for key
query { path: [key.path[0], {'kind': '__entity_group__', 'id': 1}]}
to get a __version__
property. The reliability of this data on FireStore is unknown.[Symbol(KEY)]
to represent the Key in an entity. This results in all kinds of confusion when serializing to JSON, e.g. for caching. This library adds the property _keyStr
which will be transparently used to regenerate [Symbol(KEY)]
when needed.get([key])
instead of get(key)
.insert()
and save()
sometimes return the key being written and sometimes not. So you might or might not get some data in insertResponse?.[0].mutationResults?.[0]?.key?.path
- urgs.key.id
is (usually but not always) returned as a String but you have to provide a Number to the API.Datastore-API is instrumented with prom-client. Metrics are all prefixed with dstore_
.
In an express based Application you can make them available like this:
import promClient from 'prom-client';
server.get('/metrics', async (req, res) => {
try {
res.set('Content-Type', promClient.register.contentType);
res.end(await promClient.register.metrics());
} catch (ex) {
res.status(500).end(ex);
}
});
Google Documentation
API Simplification
ORM / Schema
Others
For debugging
npx dsadmin --project=projectid
Setup your Tests like this:
child_process.execSync(`rm -Rf ./dsData`)
const port = await getPort({ port: 8081 })
emulator = new Emulator({ debug: false, port, storeOnDisk: true , clean: false, dataDir: './dsData'})
Then inspect datastore output with something like this:
/opt/homebrew/share/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator start --host=localhost --port=8081 --store_on_disk=True ./dsData & npx dsadmin --project=huwawi2
FAQs
Simplified, more consitent API for Google Cloud Datastore
The npm package datastore-api receives a total of 26 weekly downloads. As such, datastore-api popularity was classified as not popular.
We found that datastore-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.