GithubHelp home page GithubHelp logo

isabella232 / sails-google-cloud-datastore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bounteous-inc/sails-google-cloud-datastore

0.0 0.0 0.0 19 KB

Sails.js/Waterline adapter for Google Cloud Datastore

JavaScript 100.00%

sails-google-cloud-datastore's Introduction

sails-google-cloud-datastore

A Sails Waterline adapter for Google Cloud Datastore.

Usage

Install the adapter from npm:

npm install sails-google-cloud-datastore

Then, configure the adapter in https://github.com/balderdashy/sails by modifying your datastore config:

...
models: {
  datastore: 'production'
},
datastores: {
  production: {
    adapter: 'sails-google-cloud-datastore',
    projectId: 'foo',
    keyFilename: '/path/to/keyfile.json'
  }
},
...

Note: the keyFilename configuration is only required if you're not using Application Default Credentials. For more information on setting up explicit service credentials, see here.

Notes

Datastore doesn't have a concept of null, so null values will be transformed to 'NULL' on the fly, and on the off-hand chance you're setting something to 'NULL', that will be transformed to '"NULL"'.

Currently failing ~26 tests or so, mostly because the adapter doesn't support:

  • avg(), count(), sum(), or setSequence().
  • !=, nin, or like in queries

The Google-provided NodeJS library used under the hood doesn't support OR, so queries requiring OR are split into multiple queries instead, e.g.:

SELECT * WHERE first_name='DAN' OR last_name='WILKERSON'

becomes

SELECT * WHERE first_name='DAN'
UNION
SELECT * WHERE last_name='WILKERSON'

Development

To test, install the Google Cloud Datastore Emulator, then run npm run test.

Occasionally the tests will stall, missing when the emulator boots up. I'm guessing my test command is the culprit; improvements welcome!

Licensed under the MIT license.

sails-google-cloud-datastore's People

Contributors

danwilkerson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.