migrate-datastore-store
v1.0.0
Published
Store implementation for Google Cloud Datastore for migrate library
Downloads
1
Readme
migrate-datastore-store
Migrations state storage for node-migrate
Written on TypeScript and provides definition files out of the box.
API
DatastoreStore(db, [kind])
db
: Datastore instance in which state will be writtenkind
: Datastore kind in which state will be written. Default:_MIGRATIONS_STATE_
Example
ES6
import { DatastoreStore } from "migrate-datastore-store"; //also avaialbale with default import
import * as Datastore from "@google-cloud/datastore";
import * as migrate from "migrate";
const db = new Datastore({});
migrate.load({
stateStore: new DatastoreStore(db, "MY_CUSTOM_KIND")
}, function (err, set) {
...
});
or ES5
const DatastoreStore = require("migrate-datastore-store").DatastoreStore;
const migrate = require("migrate");
const db = require("@google-cloud/datastore")({});
migrate.load({
stateStore: new DatastoreStore(db, "MY_CUSTOM_KIND")
}, function (err, set) {
...
});