The pjs.data APIs allows for interaction with database objects without having to write pure SQL syntax. Which make using them simpler and more robust.
These APIs also allow for:
1) More database independent. Since you are not writing the explicit SQL syntax.
2) Can incorporate DbDefn file, which supports things such as data type overrides and shared business logic.
The pjs.query API is very powerful, however it does require that you to write valid SQL syntax that work for the running database.
These Data APIs are created so that you do not need to know much, if any, SQL.
Here are some scenarios where your SQL logic would not be simple:
- When your table or column name is also a database reserved name (like from, as, date, etc), you need to escape them in your SQL syntax, and not all databases use the same escape character.
- Not all database support all the same data types, such as Oracle does not support Date type parameters, and your SQL syntax and parameters would need to be adjusted.
- Not all database support the ? parameter marker, such as Microsoft SQL, and your SQL syntax would differ slightly.
- Some database installations support case-sensitive table and column names. If it does, your SQL syntax would need to change.
- The SQL syntax may work on one database, but not on another
These Data APIs create the correct SQL statement based on the current database and handle all these scenarios and more...