• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

strongloop / loopback-datasource-juggler
84%
master: 85%

Build:
Build:
LAST BUILD BRANCH: fix-deprecated-pkgs
DEFAULT BRANCH: master
Repo Added 30 Aug 2017 12:15PM UTC
Files 36
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix/default-value-in-response-3x
branch: fix/default-value-in-response-3x
CHANGE BRANCH
x
Reset
  • fix/default-value-in-response-3x
  • 3.x
  • 3.x-backport-1874
  • 3.x-downstream
  • 3.x-travis
  • 3.x-update-ts
  • 3x/defaultValueHandling
  • 3x/list-format
  • 3x/type-sub-property
  • add-datasource-tests
  • allow-flags-in-options
  • backport-atomic-upsert
  • chg-downstream
  • chore/add-node-12
  • chore/add-node-12-3x
  • chore/improve-issue-templates
  • chore/oracle-fielnames
  • codeowner
  • contributing
  • contributing2
  • control-pr
  • copyright
  • copyrights
  • datasource-event-type
  • deprecated-idcol
  • discover-naming
  • discussion
  • dremond_3.x_migrate_errors
  • dremond_migrate_errors
  • drop-bluebird
  • embedded-parent2
  • embedsMany/optional-default
  • enable/coveralls
  • eol
  • eslint/use-const-not-var
  • exclude-hidden-properties-from-where
  • feat/chunked-all-cb
  • feat/datasource-stop
  • feat/defaultValueHandling
  • feat/ds-begintransaction
  • feat/execute
  • feat/execute-db-command
  • feat/fix-observer-api
  • feat/ignore-matching-default
  • feat/ignore-matching-default-3.x
  • feat/lb4-operation-hooks
  • feat/memory-connector-index
  • feat/nested-applyDefaultOnWrites
  • feat/nested-applyDefaultOnWrites-3.x
  • feat/reset-datasource
  • feat/type-sub-property
  • feature/correct-model-ctor-name
  • feature/custom-defaults
  • feature/relation-properties
  • feature/remove-model
  • fix-1645
  • fix-1646
  • fix-1651
  • fix-4028
  • fix-ci
  • fix-datasource-getmodel-typing
  • fix-ds-constructor
  • fix-lazy-connect
  • fix-list
  • fix-list-of-class-instances
  • fix-ts-defs
  • fix-types/datasource-migrate
  • fix/PK-coercion-in-replaceById
  • fix/add-index
  • fix/add-index-for-couchdb
  • fix/apply-updates-from-hooks
  • fix/begintransaction-api
  • fix/coerce-or-operator
  • fix/datasource-typings
  • fix/datestring-ctor
  • fix/datestring-ctor-3x
  • fix/default-value-in-response
  • fix/destroyall
  • fix/failing-tests
  • fix/git-file
  • fix/git-file-4
  • fix/hooks-with-near-queries
  • fix/hooks-with-near-queries-3x
  • fix/include-crash-3x
  • fix/include-test
  • fix/include-test-3.x
  • fix/list-format
  • fix/listener-type
  • fix/migrate-errors
  • fix/migrate-single-model
  • fix/modification-of-datasource-config
  • fix/near-filter-cb
  • fix/nested-property-coercion
  • fix/nested-property-coercion-4x
  • fix/nested-property-resolution
  • fix/phantomjs
  • fix/postgresql
  • fix/primitive-datatypes-coercion-3x
  • fix/stop-typings
  • fix/type-defs
  • fix/types
  • fix/typings
  • fix/typo
  • fix/update-apidocs-file-list
  • fix_geo_2.x
  • fk-update-fix
  • getMaxListeners
  • globalize
  • good-first-issues-are-not-stale
  • improve-listener-signature
  • improve/github-templates
  • issue-1622-3x
  • juggler-fix
  • kv-types
  • license
  • make-test-output-concise
  • master
  • mem-connector-fix
  • memory/throw-on-malformed-types
  • nested/fields
  • optimized-findbyid
  • pr-template
  • readme
  • reduce-identifier-length-3.x
  • reduce-identifier-length-4.x
  • relational-strict
  • set-default-remote-options
  • start-4.0
  • temp
  • temp-3.x
  • temp/trigger-downstream-builds-3x
  • temp/trigger-downstream-builds-4x
  • template
  • test-3.x-downstream
  • test-ci
  • test-ci-tv
  • test/db2
  • test/filter-undefined-property
  • test/fix-default-values
  • test/master
  • test/related-fix
  • tidy-up-tests
  • travis-8
  • truongminh-set-datasource-name
  • ts-definitions
  • types/execute-nosql
  • update-codeowner
  • update-deps
  • update-dev
  • update-eslint
  • update-eslint-config
  • update-lts
  • update-lts-3x
  • update-lts-status
  • update-node-versions
  • update-nyc
  • update-strong-globalize
  • update-uuid
  • update/dependency-lodash
  • update/ds-declaration-file
  • upgrade-deps
  • upgrade-eslint-config
  • upgrade-eslint-config-3x
  • v3.12.0
  • v3.13.0
  • v3.14.0
  • v3.15.0
  • v3.15.1
  • v3.15.2
  • v3.15.3
  • v3.15.4
  • v3.15.5
  • v3.16.0
  • v3.17.0
  • v3.18.0
  • v3.18.1
  • v3.19.0
  • v3.20.0
  • v3.20.1
  • v3.20.2
  • v3.21.0
  • v3.21.1
  • v3.22.0
  • v3.22.1
  • v3.22.2
  • v3.24.0
  • v3.24.1
  • v3.25.0
  • v3.25.1
  • v3.25.2
  • v3.26.0
  • v3.26.1
  • v3.27.0
  • v3.28.0
  • v3.29.0
  • v3.29.1
  • v3.29.2
  • v3.30.0
  • v3.31.0
  • v3.31.1
  • v3.33.0
  • v3.33.1
  • v3.33.2
  • v3.34.0
  • v3.35.0
  • v3.36.0
  • v3.36.1
  • v4.0.0
  • v4.1.0
  • v4.1.1
  • v4.1.2
  • v4.10.0
  • v4.10.1
  • v4.11.0
  • v4.12.0
  • v4.12.1
  • v4.13.0
  • v4.14.0
  • v4.15.0
  • v4.16.0
  • v4.17.0
  • v4.18.0
  • v4.18.1
  • v4.19.0
  • v4.19.1
  • v4.19.2
  • v4.2.0
  • v4.2.1
  • v4.20.0
  • v4.20.1
  • v4.21.0
  • v4.21.1
  • v4.21.2
  • v4.22.0
  • v4.23.0
  • v4.24.0
  • v4.25.0
  • v4.26.0
  • v4.3.0
  • v4.4.0
  • v4.5.0
  • v4.5.2
  • v4.5.3
  • v4.5.4
  • v4.6.0
  • v4.6.1
  • v4.6.2
  • v4.6.3
  • v4.6.4
  • v4.7.1
  • v4.8.0
  • v4.8.1
  • v4.8.2
  • v4.9.0
  • v5.0.0
  • welcome-lehni
  • welcome-nitro404
  • welcome-zbarbuto

pending completion
5087

Pull #1705

travis-ci

web-flow
Do not apply default values on data from database

Before this change, when a property was configured with a default value
at LoopBack side and the database was returned a record with a missing
value for such property, then we would supply use the configured
default.

This behavior is problematic for reasons explained in #1692.

In this commit, we are introducing a new model-level setting called
`applyDefaultsOnReads`, which is enabled by default for backwards
compatibility.

When this setting is set to `false`, operations like `find` and
`findOrCreate` will NOT apply default property values on data returned
by the database (connector).

Please note that most of the other CRUD methods did not apply default
values on database data as long as the connector provided native
implementation of the operation, that aspect is not changing.

Also note that default values are applied only on properties with
`undefined` values. The value `null` does not trigger application of
default values. This is important because SQL connectors return
`null` for properties with no value set.
Pull Request #1705: Do not apply default values on data from database [3.x]

4383 of 5519 branches covered (79.42%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 1 file covered. (100.0%)

6966 of 8004 relevant lines covered (87.03%)

2780.11 hits per line

Relevant lines Covered
Build:
Build:
8004 RELEVANT LINES 6966 COVERED LINES
2780.11 HITS PER LINE
Source Files on fix/default-value-in-response-3x
  • List 0
  • Changed 13
  • Source Changed 1
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
5087 fix/default-value-in-response-3x Do not apply default values on data from database Before this change, when a property was configured with a default value at LoopBack side and the database was returned a record with a missing value for such property, then we would supply use the... Pull #1705 09 Apr 2019 11:05AM UTC web-flow travis-ci pending completion  
5086 fix/default-value-in-response-3x Do not apply default values on data from database Before this change, when a property was configured with a default value at LoopBack side and the database was returned a record with a missing value for such property, then we would supply use the... push 09 Apr 2019 11:05AM UTC bajtos travis-ci pending completion  
5083 fix/default-value-in-response-3x Do not apply default values on data from database Before this change, when a property was configured with a default value at LoopBack side and the database was returned a record with a missing value for such property, then we would supply use the... Pull #1705 09 Apr 2019 08:20AM UTC web-flow travis-ci pending completion  
5082 fix/default-value-in-response-3x Do not apply default values on data from database Before this change, when a property was configured with a default value at LoopBack side and the database was returned a record with a missing value for such property, then we would supply use the... push 09 Apr 2019 08:20AM UTC bajtos travis-ci pending completion  
5081 fix/default-value-in-response-3x fixup! address review comment Pull #1705 09 Apr 2019 08:17AM UTC web-flow travis-ci pending completion  
5080 fix/default-value-in-response-3x fixup! address review comment push 09 Apr 2019 08:17AM UTC bajtos travis-ci pending completion  
5079 fix/default-value-in-response-3x fixup! rename test model from Product to Player Avoid problem with MSSQL not dropping foreign keys during autoupdate. Pull #1705 08 Apr 2019 09:14AM UTC web-flow travis-ci pending completion  
5078 fix/default-value-in-response-3x fixup! rename test model from Product to Player Avoid problem with MSSQL not dropping foreign keys during autoupdate. push 08 Apr 2019 09:12AM UTC bajtos travis-ci pending completion  
5075 fix/default-value-in-response-3x fixup! fix tests when running against SQL dbs Pull #1705 05 Apr 2019 11:42AM UTC web-flow travis-ci pending completion  
5074 fix/default-value-in-response-3x fixup! fix tests when running against SQL dbs push 05 Apr 2019 11:42AM UTC bajtos travis-ci pending completion  
See All Builds (1395)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc