bookshelf

A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

MIT License

Downloads
274K
Stars
6.4K
Committers
178

Bot releases are hidden (Show)

bookshelf - 1.2.0 Latest Release

Published by ricardograca over 4 years ago

1.2.0 Jun 07, 2020 - Diff

Features

  • Add option to control auto refresh after save: #2070

Tests

  • Adds some more integration tests to Collection#fetch: #2079

Dependencies

  • Support Knex version 0.21.0 and up: #2072
  • Update some dependencies of dependencies to fix security warnings: #2078
bookshelf - 1.1.1

Published by ricardograca over 4 years ago

1.1.1 Mar 28, 2020 - Diff

Bug fixes

  • Fix attributes that are changed during event hook not being persisted: #2062
  • Fix incorrect query object being sent to event handlers with morphTo: #2059
  • Fix non-object attributes being passed to model.parse() in some cases: #2056

Documentation

  • Fix typo in doclet: #2057
bookshelf - 0.15.2

Published by ricardograca over 4 years ago

Change Log

0.15.2 Mar 28, 2020 - Diff

Bug fixes

  • Fix attributes that are changed during event hook not being persisted: #2063
bookshelf - 1.1.0

Published by ricardograca over 4 years ago

1.1.0 Jan 31, 2020 - Diff

Features

  • Add option to disable the count information in fetchPage: #2045

Tests

  • Small refactor to some tests: #2050

Dependencies

  • Update some dependencies to their latest versions: #2053
  • Update Knex to version 0.20.8: #2049
bookshelf - 1.0.1

Published by ricardograca about 5 years ago

1.0.1 Oct 6, 2019 - Diff

Bug fixes

  • Fix JSON.stringify causing TypeError in some cases: #2029

Documentation

  • Add documentation for Model#id: #2031
  • Fix number of arguments in Model#save doclet: #2030

Dependencies

  • Update js-yaml to version 3.13.1: #2023
  • Update handlebars to version 4.2.1: #2022
  • Update uuid to version 3.3.3: #2021
  • Update sqlite3 to version 4.1.0: #2021
  • Update sinon to 7.4.2: #2021
  • Update prettier to 1.18.2: #2021
  • Update mocha to version 6.2.0: #2021
  • Update lint-staged to version 9.2.5: #2021
  • Update jsdoc to version 3.6.3: #2021
  • Update husky to version 3.0.5: #2021
  • Update eslint-plugin-prettier to version 3.1.1: #2021
  • Update eslint-config-prettier to version 6.3.0: #2021
  • Update eslint to version 6.4.0: #2021
  • Update chai to 4.2.0: #2021
  • Update eslint-utils from 1.3.1 to 1.4.2: #2020
bookshelf - 1.0.0

Published by ricardograca about 5 years ago

1.0.0 Sep 13, 2019 - Diff

This is a big step in Bookshelf's development process. Although there are a lot of breaking changes in this release, the API will be kept stable for some time now and work will be focused on backwards compatible features and bug fixes. It's possible that Node.js 6 support will be dropped in the near future but that will be the biggest change.

There is a migration guide in the wiki to help with all of the changes in this version.

Breaking changes

  • This version requires Node.js 8+ if using a Knex version greater than 0.18.4, otherwise Node.js 6 is still supported: #1991
  • Make require: true the default for Model#fetch: #2006
  • Remove some Model and Collection lodash based methods: #2005
  • Change Collection#where so it behaves like Model#where: #2001
  • Move all plugins to their own repositories: #2000
  • Promote some useful plugins to core: #1992, #1993, #1996

Enhancements

  • Refresh model attributes after a save operation: #2012

Bug fixes

  • Fix missing columns after save: #2012
  • Fix Case Converter plugin overriding any previously defined parse methods: #2000, [email protected]
  • Fix registry saving models inadvertently across different bookshelf instances: #1996

Documentation

  • Add example of how to use custom collections: #2015
  • Improve documentation related to debug mode: #2014
  • Add note that count methods return String with Postgres: #2013
  • Fix typo in Readme: #1998
  • Better Plugin Docs: #1992, #1993, #1996, #2000

Dependencies

  • Update lint-staged to version 9.1.0: #1994
  • Update bluebird to 3.5.5: #1991
  • Update lodash to 4.17.14: #1991
  • Update mocha to version 6.1.4: #1991
  • Update mysql to version 2.17.1: #1991
  • Update pg to version 7.11.0: #1991
  • Update sinon to version 7.3.2: #1991
  • Update sinon-chai to version 3.3.0: #1991
  • Update sqlite3 to version 4.0.9: #1991
  • Update uuid to version 3.3.2: #1991
  • Update eslint-config-prettier to 6.0.0: #1957
  • Update eslint to version 6.0.0: #1986
bookshelf - 0.15.1

Published by ricardograca over 5 years ago

Change Log

0.15.1 Jun 13, 2019 - Diff

Dependencies

  • Update husky to version 2.4.1: #1984
  • Bump supported knex version to 0.17: #1982
bookshelf - 0.15.0

Published by ricardograca over 5 years ago

0.15.0 Jun 13, 2019 - Diff

Breaking changes

  • This version requires Node.js 6+
  • Remove code that has been deprecated for a long time: #1956

Bug fixes

  • once removes all events after it has been triggered: #1972
  • Pagination details are wrong when selecting distinct values of a column: #1950
  • Fix missing attributes in some events: #1934

Test Suite

  • Fix Docker-compose.yml default postgres user: #1972
  • Fix JSON tests on PostgreSQL 10+: #1955

Documentation

  • Update and fix a lot of doclets: #1951
  • Update README.md: #1940

Dependencies

  • Update mocha to version 6.1.1: #1968
  • Update eslint-config-prettier to 4.1.0: #1957
  • Update sinon to version 7.2.4: #1947
  • Update eslint to version 5.1.0: #1930
bookshelf - 0.14.2

Published by ricardograca almost 6 years ago

0.14.2 Dec 17, 2018 - Diff

Bug fixes

  • Fix crash when using groupBy with table qualifier in pagination plugin: #1928
  • Fix undefined transaction object with Knex 0.15+: #1926

Refactoring

  • Refactor logic behind .timestamp()'s decision for when to update the updated_at column: #1892
bookshelf - 0.14.1

Published by ricardograca almost 6 years ago

0.14.1 Dec 09, 2018 - Diff

Enhancements

  • Allow passing custom options to the pagination plugin's internal count method. This is useful for better interoperability with other plugins: #1914

Bug fixes

  • Fix withRelated fetch option not always grouping properly when using binary primary keys: #1918

Documentation

  • Add a basic Events guide and fix some issues with the events doclets: #1917
bookshelf - 0.14.0

Published by ricardograca almost 6 years ago

0.14.0 Dec 09, 2018 - Diff

Breaking changes

  • The previous() and previousAttributes() methods were changed so that whenever a model is saved or destroyed the previous attributes are no longer reset to the current attributes. Since the old behavior wasn't very useful it's likely this won't cause issues for many people. There's a migration guide in case you are affected by this change. #1848
  • Fix incorrect results in collection when models have duplicate ids. Checkout the migration guide in case you are affected by this. #1846
  • Empty hasOne relation will now return null instead of {} when serialized: #1839. There's a migration guide in the rare event this causes you problems.
  • Add more helpful error messages on bad or insufficient morphTo data: #1824. There's a migration guide in case you are affected by this.
  • Changed the existing functionality so that saving a model that hasn't changed will not update its updated_at attribute: #1798. Checkout the migration guide in case you are affected by this.

Enhancements

  • Make collections iterable using for ... of loops: #1830
  • Add row-level locking options: #1810

Bug fixes

  • Return clones of nested objects in previousAttributes(): #1876
  • Fix incorrect rowCount value when using groupBy with fetchPage(): #1852
  • Fix eager loading of relations when using parse/format: #1838
  • Fix inability to install bookshelf from git commit: #1835
  • Fix timestamp() setting a key named "null" in some cases: #1820
  • Fix performance of including relationships: #1800

Test Suite

  • Add test to check for adding withRelated inside events: #1853
  • Add Node.js 10 to the Travis config: #1829
  • Fix incorrect output ordering in tests in some cases: #1825

Documentation

  • Change the JSDoc theme to add a Guides section (this was already released): #1909
  • Fix hasOne's doc: #1890
  • Fix many-to-many tutorial code: #1888
  • Add code syntax highlighting for tutorials: #1850
  • Fix a few issues with the collection documentation: #1836
  • Fix Model.load() relations param: #1834
  • Fix incorrect docs for collection:fetching event: #1831
  • Add note on needing the Pagination plugin to use fetchPage(): #1803
  • Fix incorrect data types and undocumented Model property: #1797

Dependencies

  • Replace turbocolor with colorette: #1904
  • Use prettier to format all js and json files: #1883
  • Replace chalk with turbocolor: #1878
  • Update some insecure dependencies: #1841
  • Replace Babel with Node 4 compatible JavaScript: #1835
  • Update sinon to the latest version: #1833
bookshelf - 0.13.3

Published by ricardograca over 6 years ago

0.13.3 Mar 26, 2018 - Diff

Potentially breaking changes

  • Saving a model that hasn't changed will not update its updated_at attribute. This was included in a patch release because the chances of any applications depending on this behavior are very small: #1798

Bug fixes

  • Clean up automatic timestamps feature: #1798

Documentation

  • Expand documentation of the automatic timestamps feature: #1798
bookshelf - 0.13.2

Published by ricardograca over 6 years ago

0.13.2 Mar 23, 2018 - Diff

Bug fixes

  • Fix timestamps set with Invalid Date in some cases: #1796

Documentation

  • Fix incorrect data types and undocumented Model#defaults property: #1797
bookshelf - 0.13.0

Published by ricardograca over 6 years ago

0.13.0 Mar 18, 2018 - Diff

Breaking changes

  • Make require: true the default when deleting models: #1779
  • Remove the second argument to the model's destroyed event handler: #1777
  • Events are now triggered sequentially even when the handlers execute asynchronous code: #1768
  • Drop support for Node versions older than 4: #1696
  • Reorder saving and creating events to reflect the documentation: #1142

Enhancements

  • Only request returning attribute if client supports returning: #1770
  • Throw error if user doesn't pass a valid Knex instance on initialize: #1756
  • Add parameterized virtual properties to virtuals plugin: #1755
  • Add individual attribute processor plugin to core: #1741
  • Format idAttribute on save and delete: #1680
  • Add withSchema option to all database operations: #1638
  • Add a case converter plugin to core: #1093

Bug fixes

  • Fix inconsistent timestamp values between save and fetch: #1784
  • Set model.id if attributes being .set() contain a parsed version of idAttribute: #1760
  • Fix pagination plugin's fetchPage() ignoring or hanging with transactions: #1625
  • Fix fetchPage() from pagination plugin not working for relation collections: #1561
  • Don't try to update idAttribute if it hasn't changed: #1260

Test suite

  • Increase timeout of the large arrays test: #1778
  • Add test to verify that parentId is not undefined when using fetchAll with relations: #1769
  • Fixes and general improvements to the test suite: #1753
  • Remove OracleDB tests: #1744
  • Fix invalid test related to dirty attributes: #1312

Documentation

  • Improve docs about running tests: #1761
  • Fix typo on parse-and-format tutorial: #1748
  • Add Bookshelf Manager to list of community plugins: #1747

Dependencies

bookshelf - 0.12.1

Published by ricardograca almost 7 years ago

0.12.1 Jan 8, 2018 - Diff

  • Lots of documentation fixes and updates:
    • Fix incorrect value of second argument to model event handlers: #1723
    • Fix incorrect return value from .detach(): #1720
    • Fix incorrect return value from model.has(): #1712
    • Fix fetching:collection and fetched:collection not being generated or visible on the navigation bar: #1114
    • Update contributing document and issue templates: #1736
    • Add more information and links to Parse and Format docs: #1727
    • Add bookshelf-ez-fetch to Community Plugins: #1708
    • Add bookshelf-default-select to Community Plugins: #1706
    • Add information and examples about calling super() on model's initialize(): #1529
    • Add npm version badge to readme: f4dd792
  • Fix inability to attach belongsToMany relation to models fetched with fetchAll(): #1716
  • Fix foreign key = 0 not fetching related object: #1639
  • Fix unparsed previousAttributes for related models: #1457
  • Update some dependencies: #1734, #1733, #1732, #1728, #1726
bookshelf - 0.12.0

Published by mrhwick almost 7 years ago

0.12.0 Nov 27, 2017 - Diff

  • Skip visibility-plugin hidden and visible attributes #1699.
    • Used w/ <model>.toJSON({ visibility: false })
  • Updated knex peer dependency version to 0.14.x #1694.
  • Documentation typo fixes #1693.
  • Now caching node_modules to speed up travis-ci builds #1695.
  • Use Docker containers for test runs #1674.
  • Make postpublish work regardless of git remote config #1697.
bookshelf - 0.11.1

Published by mrhwick almost 7 years ago

0.11.1 Nov 15, 2017Diff

  • Fixed regression #1691: File missing on postinstall
    • npm postinstall script can be run as a part of npm prepublish script.
bookshelf - 0.11.0

Published by mrhwick almost 7 years ago

0.11.0 Nov 15, 2017Diff

  • Moved .babelrc -> src/.babelrc #1470
  • Timestamp on save now utilizes a date option for timestamp updates on insert and update. #1592
    • Used in options on save like so: m.save({item: 'test'}, { date: dateInThePast })
  • Added morphValues for morphTo relation. #1326
  • Added ability to also set timestamps as model attributes in save. #
  • Removed non-production files from packaging / added them to .npmignore #1679
  • Development Facing
    • Oracle tests only run when oracle is installed.
    • Refactoring on the registry plugin
    • Updated a lot of documents related to repo organization.
bookshelf -

Published by crunchtime-ali about 7 years ago

Changes in this version:

  • Drop Node support for 0.10 and 0.12
  • Trigger creating event for attached models
  • Add support for uninstantiated models relations
  • Add foreignKeyTarget to relation methods

Full changelog:
https://github.com/bookshelf/bookshelf/compare/0.10.2...0.10.3

bookshelf - 0.10.4

Published by Playrom over 7 years ago

Changes in this version:

  • Allow knex 0.13.x
  • Use uuid instead of node-uuid
  • Test Bookshelf with Node v7
  • Updated Author info in package.json
  • Remove lodash from build script
  • Add OracleDB integration tests
  • Add opportunity to override visible and hidden behaviour for toJSON function
  • Do not load belongsTo if foreignKey is null
  • Optimise timestamp function: respect updated_at/created_at being part of the query
  • Fix fetchPage on Collection (pagination plugin)
  • Fixing virtuals when omitNew=true
  • Lot's of typo fixes and documentation updates

Full changelog:

https://github.com/bookshelf/bookshelf/compare/0.10.3...0.10.4

Package Rankings
Top 0.61% on Npmjs.org
Badges
Extracted from project README's
NPM Version Build Status Dependency Status devDependency Status
Related Projects