Skip to content

Releases: lostpebble/pebblebed

v0.5.1 - Pebblebed.key()

21 Oct 08:00
Compare
Choose a tag to compare

Allow the basic functionality of only a string array, passed in to Pebblebed.key(), to represent the key to be created. Previous functionality allowed an array but required Pebblebed models for the "Kind" parts of the key.

This was a bug and should have always been allowed.

v0.5.0 allocateIds

17 Oct 17:15
Compare
Choose a tag to compare

Added the ability to use the following syntax:

const keys = await TestModel.allocateIds(1);

This will return an array of keys that have unique (integer) ids assigned to them - allocated from the Google Cloud Datastore to ensure uniqueness.

You can also specify an array for ancestors as a second argument.

v0.4.1

07 Aug 08:33
Compare
Choose a tag to compare

Simple fix to allow creation of Schemas in typescript without passing in a generic type. Will help with gradually changing over to more strongly-typed schemas.

v0.4.0 : Updated syntax for excludeFromIndexes to match new Datastore library version

06 Aug 17:43
Compare
Choose a tag to compare

As per this issue in @google-cloud/datastore library: googleapis/google-cloud-node#1916

Can now include the property __excludeFromIndexes in your schema definition to target properties that should be excluded from your Datastore indexes, like so:

(Typescript)

const schemaDefinition: SchemaDefinition<IDSWorkerTest> = {
  __excludeFromIndexes: [
    "testEmbeddedObject",
    "testEmbeddedObject.otherStringThing",
    "testEmbeddedObject.stringThing",
    "testLongString"
  ],
  testID: {
    type: "string",
    role: "id",
  },
  testAmount: {
    type: "double",
  },
  testTags: {
    type: "array",
    required: true,
  },
  testLongString: {
    type: "string",
    required: true,
  },
  testEmbeddedObject: {
    type: "object",
    required: true,
  },
  testDate: {
    type: "datetime",
    required: true,
  },
};

Old syntax of excludeFromIndexes flag on each property still works but is not recommended now as it doesn't allow you to target deep properties easily.

v0.3.9

28 Jul 15:32
Compare
Choose a tag to compare

Added methods for creating keys using the base Pebblebed object:

Pebblebed.keys()
Pebblebed.keysFromObjectArray()
Pebblebed.uniqueKeysFromObjectArray()

As well as now being able to use those created keys to load entities:

TestModel.load(keys).run()