Clone this wiki locally
Sadly, although there is a standard for SQL, different databases do not always agree with the standard. As such, part of the goal of ElSql is to provide a very thin veneer over some of the key differences that affect developers. The goal is not to provide a general database abstraction layer.
The database, and its differences, is encapsulated in the
Each instance has a name, such as
MySql. It also has methods that provide the rest of ElSql the ability to manage differences in the
LIKE syntax and how to do paging. The following database names are supported:
|Default||Follows standard ANSI SQL|
|Postgres||Follows standard ANSI SQL|
|HSQL||Escapes the LIKE clause with
|Oracle||Handles paging using
|SqlServer2008||Handles paging using
|Vertica||Follows standard ANSI SQL|
If a piece of SQL that must be generated is even more different, then the
.elsql file can be supplemented with a database specific one. If the main filename is
FooBar.elsql, then the override file for MySql database would be
FooBar-MySql.elsql. With this mechanism, the differences between databases can be limited and managed. Simply write ANSI SQL in the base file and database specific SQL in the database specific file as necessary.
Additional databases can be added by subclassing
ElSqlConfig. See the source code for more info.