Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

6.10.2 (2021-09-26)

6.10.1 (2021-09-21)

Bug Fixes

  • improve performance for large IN queries (ad7690b)

6.10.0 (2021-07-17)

Features

  • Do not allow a statement to have null or undefined criteria. (936988a)

6.9.1 (2021-06-21)

Bug Fixes

  • avoid overriding options.single in join queries (671b785), closes #735

6.9.0 (2021-05-13)

Features

  • $set fields to raw SQL expressions in update (64fab99)
  • support $and and $or criteria keys (211f11e)

6.8.0 (2021-04-24)

Features

  • privilege tables over columns in decomposition mapping (68d8262), closes #732

6.7.1 (2021-03-10)

Bug Fixes

  • restrict criteria value column matching to forJoin predicates, plus (d88aa7b), closes #729

6.7.0 (2021-02-27)

Features

  • support json operations ?, ?|, ?&, @?, @@ in criteria objects (2a01f65)

6.6.5 (2021-01-28)

Bug Fixes

  • revert commander 7.0.0->6.1.0 causing repl issues in node 14+ (c47f1ca)
  • revert node <11 compatibility break from murmurhash upgrade to 2.0.0 (7a6a79b)
  • track pg-promise engine version (4c9c89a)

6.6.4 (2021-01-24)

Bug Fixes

  • allow findOne on a compound readable (0b5a12a)
  • revert "docs: warn about join limitations with count and limit" -- (bbd5481)

6.6.3 (2021-01-23)

6.6.2 (2020-12-13)

Bug Fixes

6.6.1 (2020-10-19)

Bug Fixes

  • ensure the scripts directory is bundled (0ec162b)

6.6.0 (2020-07-12)

Features

  • options.fields takes a map of aliases to names, and *: true to automatically include unaliased columns (957f756), closes #706

Bug Fixes

  • deps: update dependency lodash to v4.17.19 (f71c2d1)
  • deps: update dependency pg-promise to v10.5.8 (c959b1e)
  • deps: update pg-query-stream to 3.2.0 (5b1b70f)

6.5.0 (2020-07-04)

Features

  • join conditions can test constant as well as column values (db84674), closes #718
  • join json fields (f0d1da5), closes #713

6.4.1 (2020-06-25)

Bug Fixes

  • correct doc table updated_at column comment (c622495)

6.4.0 (2020-05-06)

Features

6.3.1 (2020-05-04)

Bug Fixes

  • dependency update, especially pg-promise/pg for node v14 support (6e47a30)

6.3.0 (2020-04-11)

Features

  • flexible onConflict option for insert (d7b4deb), closes #709

Bug Fixes

  • deps: update dependency commander to v5 (638acba)
  • deps: update dependency murmurhash to v1 (e486959)
  • deps: update dependency pg-promise to v10.4.4 (cdee34f)
  • deps: update dependency pg-promise to v10.5.0 (f6b927e)
  • deps: update dependency pg-query-stream to v3.0.3 (2679895)
  • deps: update dependency pg-query-stream to v3.0.6 (5045850)
  • createDocumentTable sets loader=tables on new relations for visibility in listTables (8cf7c7e)

6.2.0 (2020-02-09)

Features

  • support all explicit locking options for SELECT (c19b17c)

Bug Fixes

  • deps: update dependency commander to v4.1.0 (c7c3520)
  • deps: update dependency commander to v4.1.1 (64d22d2)
  • deps: update dependency pg-promise to v10.3.2 (b5d2d9e)
  • deps: update dependency pg-promise to v10.4.3 (81b3d39)
  • deps: update dependency pg-query-stream to v3 (2064bdb)
  • decomposing a resultset missing a schema-defined field will not include explicit undefineds (ee34d87)
  • deps: update dependency pg-query-stream to v2.1.2 (5a970a8)

6.1.4 (2019-12-11)

Bug Fixes

  • support IN / NOT IN with an empty array (cc0aa6f)

6.1.3 (2019-12-01)

Bug Fixes

  • deps: update dependency pg-promise to v10.3.1 (e86f923)
  • give db clones a clean entityCache (0f15e61)

6.1.2 (2019-11-23)

Bug Fixes

  • deps: update dependency commander to v4.0.1 (c66d786)
  • deps: update dependency pg-promise to v10 (6a6d265)
  • get pk constraint info from pg_constraint instead of the information schema (fixes #702) (98561f2)
  • improve pk column recognition in isPkSearch (cacc514)
  • throw on attempted primary key searches of relations without primary keys (fixes #703) (40c1a8b)
  • deps: update dependency commander to v4 (87fc6a7)
  • deps: update dependency glob to v7.1.5 (f4ba198)
  • deps: update dependency glob to v7.1.6 (5f35c27)
  • deps: update dependency pg-promise to v9.3.6 (27888e6)
  • deps: update dependency pg-query-stream to v2.0.1 (144cdf7)
  • throw QueryFile errors (64355f1)

6.1.1 (2019-10-06)

Bug Fixes

  • deps: update dependency pg-promise to v9.3.3 (487cda3)
  • ensure common statement options are handled consistently (fixes #694) (da1d29a)
  • deps: update dependency commander to v3.0.2 (bc31e99)
  • deps: update dependency pg-promise to v9.2.1 (b163abf)

6.1.0 (2019-09-14)

Bug Fixes

  • deps: update dependency commander to v3.0.1 (a0698df)
  • deps: update dependency pg-promise to v9.1.2 (822b5a4)
  • deps: update dependency pg-promise to v9.1.4 (e44e54f)

Features

6.0.0 (2019-09-01)

BREAKING CHANGES

  • resultset decomposition now creates descendants as arrays by default. The 'array' decomposition schema element is no longer recognized, and has been replaced by a 'decomposeTo' element. Set this latter to 'object' to create descendants as objects.
  • deps: ES6 generators, and versions of Node prior to 7.6, are no longer supported.
  • results used to be implicitly ordered by the relation's primary key, or otherwise by the first column. This is no longer the case; ordering must be specified if it is desired.
  • supporting Readables which target more than one database relation has involved extensive changes to table loading, criteria parsing, and statement generation. These changes are intended to be backwards-compatible, but are marked as a breaking change because they cannot be guaranteed to be so.
  • JSON fields were previously converted to text and sorted alphabetically.

Bug Fixes

  • deps: update commander to v3 (a809736)
  • deps: update coveralls and standard-version (2aaf10a)
  • deps: update dependency lodash to v4.17.15 (e50b613)
  • deps: update dependency pg-promise to v8.7.5 (5ccc343)
  • deps: update eslint to 6.2.2 (e605d3a)
  • deps: update pg-promise to 9.1.0 (9e5c8be)
  • empty the entity cache on db.reload() (c986753)
  • ignore dropped columns (2a63734)
  • deps: update pg-promise to v9 (284bea6)

Features

  • allow overriding the autogenerated join decomposition schema (2e84cb3)
  • automatically deep insert when targeting a compound Readable (3235498)
  • create compound Readables with Readable.join() (75ad213)
  • decompose with compound keys (e934444)
  • decomposeTo 'dictionary' transforms records into id:record maps (6165fb5)
  • open-ended decomposeTo instead of boolean array flag; default to arrays instead of objects (b4d4b30)
  • preserve type when ordering by JSON fields (2ef6dc7), closes #683
  • use 'omit' in join schema for relations not wanted in the decomposed output (ce695d5)
  • don't add an ORDER BY clause unless explicitly called for (e78ecec)

6.0.0-rc.1 (2019-08-15)

Bug Fixes

6.0.0-rc.0 (2019-08-13)

BREAKING CHANGES

  • resultset decomposition now creates descendants as arrays by default. The 'array' decomposition schema element is no longer recognized, and has been replaced by a 'decomposeTo' element. Set this latter to 'object' to create descendants as objects.
  • deps: ES6 generators, and versions of Node prior to 7.6, are no longer supported.
  • results used to be implicitly ordered by the relation's primary key, or otherwise by the first column. This is no longer the case; ordering must be specified if it is desired.
  • supporting Readables which target more than one database relation has involved extensive changes to table loading, criteria parsing, and statement generation. These changes are intended to be backwards-compatible, but are marked as a breaking change because they cannot be guaranteed to be so.
  • JSON fields were previously converted to text and sorted alphabetically.

Bug Fixes

  • deps: update coveralls and standard-version (646c22c)
  • empty the entity cache on db.reload() (2cb7164)
  • deps: update commander to v3 (8734df4)
  • deps: update dependency lodash to v4.17.15 (e50b613)
  • deps: update pg-promise to v9 (041ebe6)

Features

  • automatically deep insert when targeting a compound Readable (191f558)
  • create compound Readables with Readable.join() (286efc6)
  • decompose with compound keys (db1d95e)
  • open-ended decomposeTo instead of boolean array flag; default to arrays instead of objects (86e60a0)
  • preserve type when ordering by JSON fields (c286e03), closes #683
  • use 'omit' in join schema for relations not wanted in the decomposed output (3d9ec65)
  • don't add an ORDER BY clause unless explicitly called for (29e2990)

5.11.2 (2019-07-17)

Bug Fixes

  • initialize inserts with correct onConflictUpdateExclude option (d868714)

5.11.1 (2019-07-12)

Bug Fixes

  • deps: update dependency lodash to v4.17.14 (9c8c0e8)
  • deps: update dependency pg-promise to v8.7.3 (6699525)
  • deps: update dependency pg-promise to v8.7.4 (3d829ea)

5.11.0 (2019-06-03)

Bug Fixes

  • use full name for materialized view refresh() (985a30a)

Features

  • onConflictUpdateExclude option to prevent upserts overwriting specified fields (4c9d9ce)

5.10.0 (2019-05-19)

Bug Fixes

  • return real error for incomplete args to Readable.search and searchDoc (c251495)
  • return real error in saveDoc/saveDocs (6fa2d88)

Features

  • onConflictUpdate option for true upserts in db.mytable.insert (a4cf534)

5.7.5 (2019-02-06)

Bug Fixes

  • cache and restore custom pg-promise receive option (#665) (f70847f)
  • package: update pg-promise to version 8.5.5 (489f443)

5.7.4 (2019-01-25)

Bug Fixes

  • recognize stringified ints as primary key search criteria (7ad4116)

5.7.3 (2019-01-20)

Bug Fixes

  • document queries include only the relevant key-value pair in criteria when matching nested arrays (fixes #662) (545aae1)
  • package: update pg-promise to version 8.5.4 (7e08207)
  • package: update pg-query-stream to version 2.0.0 (dbde097)

5.7.2 (2018-12-19)

Bug Fixes

  • cast date parameter values to timestamptz (#658) (231e944)
  • used cached promise implementation in executable error path (50ba7c5)

5.7.1 (2018-12-12)

Bug Fixes

  • use cached promise implementation to cover transaction resolve/reject edge cases (d319ca4)

5.7.0 (2018-12-05)

Bug Fixes

  • package: update pg-promise to version 8.5.3 (2b938f9)

Features

5.6.0 (2018-11-27)

Features

  • nested conjunctions in criteria objects with 'and' key (#651) (7aebccc)

5.5.3 (2018-11-10)

Bug Fixes

  • pass undefined args to query() for scripts without parameters (fixes #649) (1a1c0a6)
  • package: update pg-promise to version 8.5.2 (cc7afc3)

5.5.2 (2018-11-10)

Bug Fixes

  • pass undefined args to query() for scripts without parameters (fixes #649) (c5f1894)

5.5.1 (2018-10-17)

Bug Fixes

  • package: update commander to version 2.19.0 (68d72e3)
  • correct param defaults for Database.query (49e6af3)
  • package: update pg-promise and pg-query-stream to the latest version 🚀 (#641) (8de72f8)

5.5.0 (2018-09-30)

Features

  • introspect and load enums as static db.enums (095266f)

5.4.0 (2018-09-16)

Bug Fixes

  • package: update commander to version 2.18.0 (c2209ee)
  • package: update lodash to version 4.17.11 (8863a10)
  • correct where generation logic from bad merge (5891b00)

Features

  • load non-pk sequences and get current value (a2912b2)
  • reset and increment sequences (3796b27)
  • restrict returned fields from persistence queries (8a10110)

5.3.0 (2018-09-07)

Features

  • specify null sorting in order by (149b7b9)

5.2.1 (2018-09-05)

Bug Fixes

  • package: update glob to version 7.1.3 (f8ec670)
  • package: update pg-promise to version 8.4.6 (8a885f1)

5.2.0 (2018-08-12)

Bug Fixes

  • package: update commander to version 2.17.0 (74a784f)
  • package: update commander to version 2.17.1 (3b60ea9)

Features

  • keyset pagination on sorted queries (1ce70c7)

5.1.3 (2018-07-17)

Bug Fixes

  • clean unused params from updates (352969f)

5.1.2 (2018-07-17)

Bug Fixes

  • filter out nonexistent columns from update generation (e913088)

5.1.1 (2018-07-12)

Bug Fixes

  • update instance refs properly for cloned executables (fixes #617) (8033cb8)

5.1.0 (2018-07-06)

Features

  • new loader option for UUID primary keys in document tables (#614) (b8203d4)

5.0.0 (2018-06-03)

Bug Fixes

  • apply allowedSchemas to function loader (8bcccc3)
  • better error messaging around writing to foreign tables (73cef19)
  • correct behavior for save with tables lacking pks (d87e340)
  • process document search vectors from text for backwards-compatibility (dacb3ec)
  • reject if select options.fields is explicitly empty (fixes #583) (18e05ce)
  • updateDoc takes query options (95760cb)

Code Refactoring

  • change modify to updateDoc for table/document api consistency (373088a)
  • remove deprecated '*' criteria (80fb89d)
  • remove deprecated columns select option (64c294d)
  • remove deprecated db.run (705bd83)
  • remove unary update in favor of save (d2b8d56)

Features

  • add withConnection for tasks (2d13133)
  • allow primary key in update() (c606a8d)
  • brute force copy api for transactions (ceeb202)
  • disable deep insert by default (ed7a655)
  • full document search with stored vector (b8f84f7)
  • introduce order exprs (f42a187)
  • load tables even if they don't have primary keys (0457cc1)
  • metadata in documents (25212d9)
  • support updatable views (fixes #528) (9aac96a)

BREAKING CHANGES

  • empty options.fields is now recognized as an error instead of falling back to '*'
  • db.run is gone; please use db.query instead
  • 'created_at' and 'updated_at' are now reserved keys in documents
  • db.doctable.modify is now db.doctable.updateDoc
  • update() now requires separate criteria and changes objects, use save() to update self-contained record objects
  • field for updateDoc() against non-standard json column name should now be specified with options.body
  • deepInsert option must be truthy to enable this behavior
  • unsafe literal {order: 'string asc'} syntax has been removed
  • find, countDoc, etc no longer accept '*' in place of an empty criteria object
  • using 'columns' option in find etc has been removed; use 'fields' for columns themselves and 'exprs' for potentially unsafe operations
  • functions in disallowed schemas will no longer be loaded

5.0.0-rc.2 (2018-05-28)

Bug Fixes

  • apply allowedSchemas to function loader (51d5839)
  • better error messaging around writing to foreign tables (9f087a1)
  • correct behavior for save with tables lacking pks (ff235fe)
  • process document search vectors from text for backwards-compatibility (e6e1c50)
  • reject if select options.fields is explicitly empty (fixes #583) (7a5463c)
  • updateDoc takes query options (6523402)

Code Refactoring

  • change modify to updateDoc for table/document api consistency (1744f8a)
  • remove deprecated '*' criteria (d3c63d2)
  • remove deprecated columns select option (63eda28)
  • remove deprecated db.run (0df49df)
  • remove unary update in favor of save (c570f13)

Features

  • add withConnection for tasks (0510766)
  • allow primary key in update() (a2cb9ae)
  • brute force copy api for transactions (5b7e7f7)
  • disable deep insert by default (7ad25e1)
  • full document search with stored vector (8564da3)
  • introduce order exprs (d4b76fc)
  • load tables even if they don't have primary keys (8f58ecb)
  • metadata in documents (c782ce1)
  • support updatable views (fixes #528) (8000888)

BREAKING CHANGES

  • empty options.fields is now recognized as an error instead of falling back to '*'
  • db.run is gone; please use db.query instead
  • 'created_at' and 'updated_at' are now reserved keys in documents
  • db.doctable.modify is now db.doctable.updateDoc
  • update() now requires separate criteria and changes, use save() to update record objects
  • field should now be specified with options.body
  • deepInsert option must be truthy to enable this behavior
  • unsafe literal {order: 'string asc'} syntax has been removed
  • find, countDoc, etc no longer accept '*' in place of an empty criteria object
  • using 'columns' option in find etc has been removed; use 'fields' for columns themselves and 'exprs' for potentially unsafe operations
  • functions in disallowed schemas will no longer be loaded

4.8.3 (2018-05-22)

Bug Fixes

  • delimit junction table names in deep inserts (bbd784d)

4.8.2 (2018-05-12)

Bug Fixes

  • fields can be restricted in document searches (fixes #595) (162b3d9)
  • support traversal properly inside documents (fixes #594) (8b49661)

4.8.0 (2018-05-06)

Bug Fixes

  • package: update pg-promise to version 8.3.0 (#587) (8111477)
  • package: update pg-promise to version 8.4.0 (#588) (8c8dfac)

Features

  • refresh materialized views (ac278af)

4.7.2 (2018-04-17)

Bug Fixes

  • better messaging for deep insert errors (closes #556) (#571) (8ff4045)
  • throw an appropriate error if decompose encounters a null root pk (closes #568) (#570) (5569060)
  • use Object.hasOwnProperty (fixes #579) (d0c4bec)

4.7.1 (2018-03-10)

Bug Fixes

  • date casting in documents should use timestamptz (fixes #563) (a8c603f)
  • package: update commander to version 2.15.0 (#562) (d5434f9)
  • package: update pg-promise to version 8.1.1 (#560) (4265e21), closes #554
  • package: update pg-promise to version 8.2.0 (#566) (9cd4e65)

4.7.0 (2018-02-22)

Features

4.6.6 (2018-02-20)

Bug Fixes

  • ensure the columns array has no duplicates when using composite keys (#549) (1024485)

4.6.5 (2018-02-14)

Bug Fixes

  • package: update commander to version 2.14.0 (#532) (157a17c)
  • package: update pg-promise to version 7.5.2 (#538) (b4cec78), closes #537
  • rework table load for inheritance with proper pk tracking (fixes #539) (#540) (4d35bc8)

4.6.4 (2018-02-03)

Bug Fixes

  • decompose should preserve ordering of query results (#531) (d13bb2f)

4.6.3 (2018-01-12)

Bug Fixes

  • package: update commander to version 2.13.0 (#523) (c173bb8)
  • pass decompose option from non-select statements (fixes #522) (#524) (19c668b)

4.6.2 (2018-01-08)

Bug Fixes

  • prevent double-counting foreign tables which inherit from other tables (90ec61e)

4.6.1 (2018-01-05)

4.6.0 (2018-01-01)

Bug Fixes

  • package: update commander to version 2.12.0 (#513) (cf35ce6)

Features

4.5.0 (2017-11-12)

Bug Fixes

  • improve connect/reload handling in tests (6f47708)

Features

  • deep insert into related tables (6bb4c6b)
  • deprecate columns for split fields+exprs with idiomatic json traversal (1deba7f)
  • variadic function support (closes #431) (ae00a50)

4.4.0 (2017-10-10)

Features

  • option to exclude materialized views (#392) (da4119c)

4.3.0 (2017-09-29)

4.2.0 (2017-09-20)

4.1.0 (2017-09-17)

4.0.1 (2017-09-14)

Bug Fixes

  • package: update mz to version 2.7.0 (#464) (cbb61d6)

4.0.0 (2017-09-06)

3.2.0 (2017-08-11)

3.1.0 (2017-07-22)

3.0.0 (2017-06-25)

3.0.0-rc1 (2017-05-31)

2.6.1 (2017-05-11)

2.2.0 (2016-03-28)

2.1.0 (2015-12-08)

2.0.6 (2015-08-12)

2.0.5 (2015-07-08)