Skip to content

Database Integration Tests : SQL Generation

Ephrim Stanley edited this page Mar 15, 2022 · 2 revisions

We run many SQL generation tests. Some of them are run against real databases. These tests are run as follows.

Test Mechanics

  • A SQL generation test is written in Pure using the light IDE.
  • Pure code is used to generate the Pure execution plan.
    • The execution plan requires a specification of a database connection. Note : This is not a JDBC connection. Just a piece of JSON that describes which database should be used for the connection.
    • The engine test server provides a "test connection specification" API that serves test connection specifications.
    • Pure code that generates the execution plan gets the connection specification from this "test connection specification" API.
    • Engine test server implementations are free to generate these specifications as they see fit. For e.g they can use existing databases or create new ones on the fly etc.
  • Once generated, the Pure execution plan is sent to the engine test server for execution
    • The engine server simply executes the execution plan and returns the result
  • Finally, the test results are rendered in the light IDE