Skip to content

Fortune.js adapter for GCloud Datastore - Highly Scalable NoSQL Database.

License

Notifications You must be signed in to change notification settings

patrinhani-ciandt/fortune-datastore

Repository files navigation

Code Climate Travis-CI

Fortune Google Cloud Datastore Adapter

This is a Google Cloud Datastore adapter for Fortune.

Usage

Install the fortune-datastore package from npm or yarn:

$ npm install fortune-datastore

or

$ yarn add fortune-datastore

Then use it with Fortune:

import fortune from 'fortune'
import datastoreAdapter from 'fortune-datastore'

const store = fortune({...},  {
  adapter: [
    datastoreAdapter,
    {
      projectId: 'my-gcp-project-id',
      keyFilename: 'gae_service_account_key.json',
      namespace: 'fortune-adapter-test'
    }
  ]
})

Adapter Options

Event Description
generateId Generate the id key on a new record. It must be a function that accepts one argument, the record type, and returns a unique string or number. Optional.
projectId The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.
keyFilename Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.
namespace Namespace to isolate transactions to.

License

This software is licensed under the MIT License.

About

Fortune.js adapter for GCloud Datastore - Highly Scalable NoSQL Database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published