Vinci Part #9 - Improved Logic for Locating "Default" Statements
There has been a lot of confusion in the past about how DA picks the appropriate statement for a data table, if more then one connection is involved, and couple new properties have been added to ease this in Vinci.
- A “ConnectionType” was been added the connections, which will be pre-filled in SM from the driver (to, say, “MSSQL”), but is user-editable. This can be used to logically group connections that use similar statements, whether based in SQL dialect, database structure or any other factor
- “ConnectionType” has also been added to the statements, specifying (optionally) which type of connection the statement applies to.
- A boolean “Default” property has also been added to the statements.
At runtime, Data Abstract will use the following logic to locate statements:
- check for a statement matching the active connection (as in v4 and below)
- check for a statement matching the connection type of the active connection
- check for a statement marked as “Default”
- continue using the old system, by looking for statement for the “default” connection
In addition, the new “AutoSQL” functionality (which i’ll be discussing in a separate post) will figure in as a possible fifth step to automatically generate the necessary “SELECT” statement, if needed.
This system should make it a lot more intuitive to set up Schemas with multiple statements and connections, while at the same time providing new flexibility to allow scenarios that were not easy to achieve before (such as, for example, several groups of connections sharing separate statements).