https://github.com/svozza/neptune-lambda-client
Gremlin client to robust query AWS Neptune from AWS Lambda
https://github.com/svozza/neptune-lambda-client
Last synced: over 1 year ago
JSON representation
Gremlin client to robust query AWS Neptune from AWS Lambda
- Host: GitHub
- URL: https://github.com/svozza/neptune-lambda-client
- Owner: svozza
- License: mit
- Created: 2022-01-21T17:48:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-25T13:03:39.000Z (almost 4 years ago)
- Last Synced: 2025-02-25T05:06:00.838Z (over 1 year ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neptune-lambda-client
## Overview
A very simple Gremlin client to robustly query AWS Neptune from AWS Lambda. The client will automatically
reestablish a connection to the database if the web socket connection closes and will also automatically
retry (5 times) when it encounters `ConcurrentModificationException` and `ReadOnlyViolationException` errors.
## Usage
This client is instantiated with a factory function and exposes a single function called `query`. `query` accepts
a single argument, which is a function that use the Gremlin `g` object.
```js
const gremlinClient = require('neptune-lambda-client');
const {query} = gremlinClient.create({
host: 'neptune-db-url',
port: '8182',
useIam: true
});
async function getNode(id) {
return query(async g => g.V(id).next().then(x => x.value));
}
```