It is built such that each separate operation has its own unique URL. This has a lot of benefits, since it’s easy to grant or deny access to some resource, and discriminate access clearance, according to the URL, and the user’s role. But first, let’s talk about our 4 different operations.
You can easily perform a select type of query, through an HTTP GET request, which again will return some JSON object, containing the results of your query. Pass in criteria for your select as query parameters, and you can decorate it easily. Below is an example.
The above will retrieve 10 items from the “your-database” database, and its “your-table” table. It will order the results by the “name” column, and select from the 50th item and out. It will return a JSON array, containing only the “name” and the “email” columns. Since it is very easy to assign access right to a virtual URL such as the above in Phosphorus Five, this allows you to assign access right to users, according to their roles.
In addition to “select” queries, you can also do “insert”, “update” and “delete” – And it will generically work, regardless of your database schema, towards any table, allowing you to apply a whole range of parameters, filtering your end results one way or another. If you want to select only items that are beyond the name of “Hansen” for instance, you can add a where clause, using the >= operator, as a part of your HTTP GET query.
You can find the project here. Notice, it’s currently in ALPHA state …
You can see a video of me demonstrating it below. The project contains some sample code, which you can probably easily modify to serve your own needs.