Skip to content

Config syntax

Alexander Levin edited this page Apr 19, 2017 · 3 revisions

pools

Optional array of string identifiers. The resource will be accessible only in the pools with matching identifiers. The pools are configured with server/config/sqlanywhere/connectionParams.js.

collection

The resource identifier within pools. Full resource url is /api/{pool}/{collection}

tableName

Name of the table in the database to read and save data to.

selectFrom

Optional, if specified used to read data instead of tableName

extends

Optional name of a collection to inherit the config from.

abstract

Boolean, if true means the resource is not directly accessible, used to config an ancestor to config other collections with extend.

alias

Optional string used as SQL alias

deletable

Specifies if the api allows DELETE method otherwise HTTP 403 is thrown.

Boolean true means rows in database are deleted with SQL DELETE.

String with format 'field=value' means DELETE is transformed to SQL UPDATE set field = value. GET/PUT/POST methods will use additional SQL predicate NOT(field=value)

Clone this wiki locally