sum
, average
, min
, max
, and groupBy
) are no longer supported in criteria. Instead, see new model methods.limit: 0
no longer does the same thing as limit: undefined
. Instead of matching ∞ results, it now matches 0 results.skip: -20
no longer does the same thing as skip: undefined
. Instead of skipping zero results, it now refuses to run with an error.Infinity
is tolerated and normalized to Number.MAX_SAFE_INTEGER
automatically.)where
clause are no longer supported.{ username: 'santaclaus', limit: 4, select: ['beardLength', 'lat', 'long']}
,{ where: { username: 'santaclaus' }, limit: 4, select: ['beardLength', 'lat', 'long'] }
.{ username: 'santaclaus' }
as shorthand for { where: { username: 'santaclaus' } }
-- it's just that you can't mix other top-level criteria clauses (like limit
) alongside constraints (e.g. username
).limit: undefined
, but it now logs a deprecation warning to the console..populate()
, repeated use of any other one chainable query method like .sort()
, .where()
, .set()
, .meta()
, etc is no longer supported. For example, you should not do: User.find().where({username: 'santaclaus'}).where({location: 'north pole'})
index
for automigrations.create()
and .createEach()
no longer deals with updating the current autoincrement sequence (the "next value to use") when a record with a greater value is explicitly createdcolumnType
. If specified, the columnType
is sent to the appropriate adapter during automigration (in sails-hook-orm). This allows Sails/Waterline models to indicate how the values for individual attributes should be stored at rest vs. how they are validated/coerced when your code calls .create()
or .update()
.type
and columnType
.defaultsTo
can no longer be specified as a function. In practice, this can lead to unintended consequences, and its implementation was adding considerable weight and complexity to Waterline (without a whole lot of tangible benefit).null
. If they are set to type: 'json'
or type: 'ref'
, and there is no defaultsTo
, then null
is stored. But, if an attribute declares itself as type: 'string'
, then when a record is created without specifying a value for that attribute, it is stored as ''
(empty string). Similarly, type: 'number'
is stored as 0
, and type: 'boolean'
as false
. To represent an attribute which might be null
or a string, use type: 'json'
(combining it with the new isString
validation rule, if you like)..populate()
required
& allowNull
required
required
, it means that a value for the attribute must be defined when using Waterline to do a .create()
.foo
is a required attribute, then passing in foo: undefined
or omitting foo
on a .create()
would fail the required check.''
(empty string) or null
would fail the required check.type: 'string'
, then if a value for that attr is explicitly provided as null
in a .create()
or .update()
, it will no longer be allowed through-- regardless of the attribute's required
status.null
out of the box. To support a string attribute which might be null
, you'll want to set the attribute to type: 'json'
. If you want to prevent numbers, booleans, arrays, and dictionaries, then you'll also want to add the isString: true
validation rule.[BUGFIX] Fix issues with compatibility in alter auto-migrations. This was causing corrupted data depending on the permutation of adapter version and Waterline version. This should be fixed in the SQL adapters that support the new select query modifier.
[ENHANCEMENT] Updated dependencies to remove warning messages when installing.
id
in schemaless mode. See #1326 for more details.[ENHANCEMENT] Allows attribute definitions to contain a meta
property that will be passed down to the adapter. This allows arbitrary information about an attribute to be passed down to interactions on the physical storage engine. Going forward any adapter specific migration information should be sent via the meta
property. See #1306 for more information.
[ENHANCEMENT] Allows for the use of .select()
to build out projections in both top level queries and association queries. See #1310 for more details and examples.
[ENHANCEMENT] Allow for the ability to pass in extra data to an adapter function using the .meta()
option. This could be used for a variety of things inside custom adapters such as passing connections around for transactions or passing config values for muti-tenant functionality. For more details see #1325.
through
model is being used, and custom column names are configured. Originally identified in this StackOverflow question (Thanks @ultrasaurus!) 8b46f0f, 1f4ff37.add()
idempotent in 2-way collection associations -- i.e. don't error out if the join record already exists. Fixes [#3784](https://github.com/balderdashy/sails/issues/3784 (Thanks @linxiaowu66!) a14d16a,5b0ea8bid
in schemaless mode. See #1326 for more details.[BREAKING CHANGE] Removed the second argument from .save()
commands that returns the newly updated data that has been re-populated. This should increase performance and limit memory. See #1295 for more details.
[ENHANCEMENT] Errors coming from .save()
now return actual Error objects that have been extended from WLError
.
[BUGFIX] Fixes issue with dynamic finders not understanding custom columnName
attributes. See #1298 for more details. Thanks @HaKr for the detailed test case.
[ENHANCEMENT] Auto timestamps column names are now overridable. See#946 for more details. Thanks @Esya for the patch.
[ENHANCEMENT] Add support for an array of values to be passed into populate
. ex .populate(['foo', 'bar'])
. See #1190 for more details. Thanks @luislobo for the patch.
[ENHANCEMENT] Ensures that createdAt and updatedAt are always the exact same on create
. See #1201 for more details. Thanks @ziacik for the patch.
[BUGFIX] Fixed issue with booleans not being cast correctly for validations. See #1225 for more details. Thanks @edupsousa for the patch.
[BUGFIX] Fixed bug where dates as primary keys would fail serialization. See #1269 for more details. Thanks @elennaro for the patch.
[BUGFIX] Update support and patch some bugs in Many-To-Many through associations. See #1134 for more details. Thanks @atiertant for the patch.
[BUGFIX] Fix issue with through
table joins. See #1134 for more details. Thanks @atiertant for the patch!
[ENHANCEMENT] Bump version of Waterline-Schema to the latest.
[ENHANCEMENT] Update Travis tests to run on Node 4 and 5.
in
criteria removing more data than it should. See #1076 for more details. Thanks @slester for the patch!defaultsTo
not setting values for undefined values.See https://github.com/balderdashy/waterline/commits/f5efc0349fe9594a962357287bb6c25acdda9a76.
Earlier still?
For the first year or so, Waterline lived in the main Sails repo. See https://github.com/balderdashy/sails/commits/master?after=q8Jnoggc%2F%2B7O7021adjRanuRhssrNDM3NA%3D%3D and back.