CodeFluent Query Language Overview
CodeFluent Query Language (CFQL) is a simple yet powerful language which allows developers to write stored procedures in their models. Therefore, CFQL is platform independent and its producers which will translate this query into an actual stored procedure.
The language itself is a mix of traditional SQL and object-oriented syntaxes (btw, the language is case insensitive):
<method> (<arguments>) [from <source>] [<where> <expression>] [<order by> <expression>]
Available methods are:
- Load / loadone: creates a procedure to return one or multiple instances from the database,
- Search: similar to load methods, however arguments are optional/nullable, supports wildcards (e.g. ‘*’), and the resulting SQL is built dynamically at run time in order to support as many optional parameters as you desire,
- Count: return a number being the result of the count operation (uses the count SQL clause),
- Delete: allows developers to delete batches of records from the persistence layer (and avoid doing deletes in a foreach)
- Raw: allows developers to specify custom persistence code because CFQL does not intend to replace persistence code, so you can’t do everything with it.