For a complete overview of what's changed since v0.9.x, see http://beta.sailsjs.org/#documentation/reference/Upgrading/Upgrading.html.
- Associations
- Adapter-level support for optimized joins (SQL databases and Mongo)
- Built-in support for in-memory joins. Allows for cross-database and even cross-adapter joins! (e.g. a User in Mongo has many Messages in a MySQL database called
legacy_messages
, and also a Role in a MySQL database calledmyapp
. These can be automatically joined together using the same ORM syntax as normal.)
- Better Error Handling in Waterline
- Revamped Sails CLI
- Generators w/ support for coffeescript
- Support for dry runs (
--dry
) forsails generate
andsails new
- Experimental support for custom generators
- API Blueprints
- Blueprints are injected into project, allowing the built-in API to be customized.
- Dramatic simplification of how blueprints are injected-- by implicitly including them in the routes file.
- Backwards compatibility for blueprints on <=v0.9 apps can be achieved by plugging in a simple config to re-enable the traditional support and configurations.
- Blueprint routes automatically take associations into account, e.g.:
- PubSub
- Simplified dramatically- removed concept of class rooms (most of the time, this isn't exactly what you want anyways)
- Blueprints still work the same way by introspecting your app's schema and taking advantage of information about assocations to create logical publish/subscribe dependencies, relying on the global channel in cases where a shared instance doesn't exist.
- Reduced to a handful of simple methods:
SomeModel.publish()
-- publish to model instanceSomeModel.subscribe()
-- subscribe socket to model instanceSomeModel.unsubscribe()
-- unsubscribe socket from model instancesails.publish()
-- publish to global channelsails.subscribe()
-- subscribe socket to global channelsails.unsubscribe()
-- unsubscribe socket to global channel
- Error Negotiation Shortcuts
- Automatically content-negotiate a response-- configurable in
500.js
,404.js
,400.js
,403.js
res.serverError( msgOrObj )
res.notFound()
res.forbidden( msgOrObj )
res.badRequest( msgOrObj )
- Automatically content-negotiate a response-- configurable in
Deprecated
Overview
The following features are considered deprecated and should at some point be removed from the codebase
Dynamic Finder Methods
- .findOneBy
<attribute>
In() - .findOneBy
<attribute>
Like() - .findBy
<attribute>
In() - .findBy
<attribute>
Like() - .countBy
<attribute>
In() - .countBy
<attribute>
Like() - .
<attribute>
Contains()
CRUD Class Methods
- .findAll()
- .findOneLike()
- .findLike()
- .contains()
- .join()
- .select()
- .findOrCreateEach()
- .join()
- .startsWith()
- .endsWith()