Skip to content
This repository was archived by the owner on Mar 4, 2019. It is now read-only.

Releases: dmfay/massive-js

v4.0.1

Choose a tag to compare

@dmfay dmfay released this 17 Sep 20:37

The bulk form of insert now respects records with different key orders. 4.1.0 should be preferred over this release since it has even better handling for bulk inserts.

v4.0.0

Choose a tag to compare

@dmfay dmfay released this 06 Sep 03:22

We're sticking to proper semver now, so this is a much less radical change than v2 to v3 was 😀

Breaking changes

  • JSON traversal is now a lot simpler! If you were only using the built-in document table functionality, no need to worry since that's the same; but if you were building criteria objects with keys like my_json_field->>innerField, you can now use standard JavaScript . and [] notation and Massive will take care of the rest.
  • find has been standardized on criteria objects, and will no longer accept a * wildcard.
  • Loader filters are also standardized: schema filters no longer accept all or * wildcards.

New stuff

Only one item in here, but it's a big one: resultset decomposition has arrived! Check out the documentation for a full description, but otherwise I'll let the testcase speak for itself:

const issues = yield db.everything.find({}, {
  decompose: {
    pk: 'user_id',
    columns: {
      user_id: 'id',
      username: 'username'
    },
    tests: {
      pk: 'test_id',
      columns: {
        test_id: 'id',
        name: 'name'
      },
      array: true,
      issues: {
        pk: 'id',
        columns: {
          id: 'id',
          user_id: 'user_id',
          test_id: 'test_id',
          description: 'description'
        },
        array: true
      }
    }
  }
});

assert.deepEqual(issues, [{
  id: 1,
  username: 'alice',
  tests: [{
    id: 1,
    name: 'alice\'s test',
    issues: [{
      id: 1,
      user_id: 1,
      test_id: 1,
      description: 'alice\'s issue'
    }]
  }]
}, {
  id: 2,
  username: 'bob',
  tests: []
}, {
  id: 3,
  username: 'carol',
  tests: [{
    id: 2,
    name: 'carol\'s first test',
    issues: []
  }, {
    id: 3,
    name: 'carol\'s second test',
    issues: [{
      id: 2,
      user_id: 3,
      test_id: 3,
      description: 'carol\'s issue'
    }]
  }]
}]);

v3.3.0

Choose a tag to compare

@dmfay dmfay released this 02 Sep 17:54

Fingers crossed this is it before I finish cleaning up v4:

  • Database class can be used directly
  • use options object in where()
  • findOne no longer throws with options.single set

v3.2.2

Choose a tag to compare

@dmfay dmfay released this 21 Aug 11:35

Just some internal dependency management fixes, and bumps the required version of pg-promise to v6.5.0. If you've been wondering what formatDBType is, grab the upgrade!

v3.2.1

Choose a tag to compare

@dmfay dmfay released this 17 Aug 04:06

Updates the driver to fix a code execution vulnerability.

v2.7.2

Choose a tag to compare

@dmfay dmfay released this 17 Aug 04:06

Updates the pg driver to fix the code execution vulnerability.

v3.2.0

Choose a tag to compare

@dmfay dmfay released this 11 Aug 22:04

One for the road, as work begins in earnest on some breaking changes for v4. New features:

  • Massive will respect the connecting user's default search_path in the event that it isn't public.
  • insert has a new onConflictIgnore option to prevent errors on collision.

v3.1.0

Choose a tag to compare

@dmfay dmfay released this 22 Jul 06:03

By weight this one's mostly internal cleanup and refactoring left over from 3.0.0, but there are some goodies:

  • Table.modify accepts a criteria object for bulk document changes
  • IS and IS NOT operators explicitly supported
  • Function invocation signatures sorted out
  • Field discovery bugfix with Table.update
  • Stricter checks for valid input in Table functions
  • Fewer (hopefully no) driver warnings about inefficient I/O

v2.7.1

Choose a tag to compare

@dmfay dmfay released this 21 Jul 22:59

Fixes a major bug with the 2.7.0 release's criteria parser.

v2.7.0

Choose a tag to compare

@dmfay dmfay released this 15 Jul 02:08

New IS and IS NOT operators in this update to the legacy v2.