Data models that can be stored in any database or remote service using adapters.
$ npm install tower-resource
$ component install tower/resource
var resource = ;
// defaults to 'string';
// some hypothetical one;
There are two DSL methods for validation.
validate: for using predefined validations (see tower-validator), purely to clean up the API.
validator: for defining custom validator functions right inline. If you want to reuse your custom validator function across resources, just move the function into tower-validator.
See tower-query for the entire syntax. The
where method just delegates to a
Query instance. You can also access the query object directly (it just adds
.select(resourceName) for you):
There are 4 main actions for resources (which are just delegated to
Under the hood, when you execute one of these actions, they get handled by a database-/service-specific adapter (mongodb, cassandra, facebook, etc.). Those adapters can perform optimizations such as streaming query results back.