A data mapper for Node.js and PostgreSQL.
Decompose schemas are now properly applied to insert and update functions.
Fixes an edge case where foreign tables can be double-counted if they inherit from other tabkes, preventing initialization.
Security release since a vulnerability was found in earlier versions of marked
, a transitive dependency of JSDoc.
Massive now composes database APIs more intelligently. Now you can have a companies
table and a db/companies
script directory, and use both! db.companies
will be a table with the usual set of query and persistence functions, but it's also a namespace for your scripts and you can db.companies.doSomethingComplicated()
.
There are only a couple of scenarios that won't work with this:
companies.findOne
)In both cases, you'll get an exception on spinup.
Updates the deasync
dependency to fix an error in older versions.
insert
a record along with related rows in a single transaction!db.run
will be removed in a future release. Update your code to use db.query
instead.Adds the ability to toggle materialized views on or off (required if you're using a version of Postgres older than 9.3).
The order
option uses standard JavaScript object/array path notation for elements in JSON fields instead of the native Postgres traversers, making it consistent with JSON usage in criteria objects. Sort direction is also now case-insensitive.
New feature: simpler decompose schemas: use an array of columns
instead of a map if you aren't changing any names.
insert
can accommodate records with different key sets: [{field1: 'value1'}, {field2: 'value2'}]
is valid assuming there are no NOT NULL
constraints in play.insert
and update
.