Using RQL to Query Data
Overview
RQL converts SQL-like commands into filtered REST calls.
RQL supports 'relations' (include) that allows data to be joined in at runtime without using SQL.
Can be safely used on the client or on the server.
Notes
When using 'include' the fields that support the foreign keys must either be specified in the field list or '*' must be used to include all fields.
Examples
get * from account order by accountid
get rowid, itemid, itemtypeuid from itemview where itemtypeuid=='stockitem' order by itemid
get rowid, transactionid, transactiontyperowid, description, transactiondate, totalamount, isprint, isactive, relationshiprowid, paymentmethodlistitemrowid from transaction where transactiontyperowid==17 include paymentmethod, relationship, transactiontype
RQL Keywords
Key Word | Description |
GET | |
FROM | |
WHERE | |
ORDER BY | |
INCLUDE |
Operators
Description | Operator |
Equals | == |
Not Equals | != |
Less Than | < |
Greater Than | > |
Less Than or Equal To | <= |
Great Than or Equal To | >= |
Contains | =in= |
Like | =like= |
Not Like | =nlike= |
AND | ; |
OR | , |
Includes
Model | Include Keyword | Relationship | Type | Returns |
Account | notes | account.rowid -> note.accountrowid | 1:n | array |
Account | accounttype | account.accounttyperowid -> accounttype.rowid | 1:1 | object |
Address | notes | address.rowid -> note.addressrowid | 1:n | array |
Contact | notes | contact.rowid -> note.contactrowid | 1:n | array |
Contact | tasks | contact.rowid -> task.contactrowid | 1:n | array |
Item | notes | 1:n | array | |
Job | notes | 1:n | array | |
Relationship | addresses | 1:n | array | |
Relationship | contacts | 1:n | array | |
Relationship | notes | 1:n | array | |
Relationship | tasks | 1:n | array | |
Task | notes | 1:n | array | |
Transaction | transactiondetails | 1:n | array | |
Transaction | transactiontype | 1:1 | object | |
Transaction | relationship | 1:1 | object | |
Transaction | address1 | 1:1 | object | |
Transaction | address2 | 1:1 | object | |
Transaction | address3 | 1:1 | object | |
Transaction | notes | 1:n | array | |
Transaction | tasks | 1:n | array | |
Transaction | customermessage | 1:1 | object | |
Transaction | paymentmethod | 1:1 | object | |
Transaction | priority | 1:1 | object | |
Transaction | salessource | 1:1 | object | |
Transaction | salesstatus | 1:1 | object | |
Transaction | saletype | 1:1 | object | |
Transaction | shippingmethod | 1:1 | object | |
Transactionview | contact | 1:1 | object |
Last updated