The first step would be a simple asynchronous backend that extends
RelationalBackend but not
JdbcBackend. The DBIO interpreter in
BasicBackend should be perfectly usable for both, blocking and non-blocking I/O. It has some special support for
SynchronousDatabaseAction that an asynchronous driver (unlike
JdbcBackend) simply wouldn't use. You need to add a new DBIO type for asynchronous database actions and make the interpreter handle it correctly. You also need a way to configure database connections and handle transactions appropriately.
The result of this work should be a backend that allows you to instantiate a configured
Database and run DBIO actions on it that consist of an asynchronous equivalent of
SimpleJdbcAction and all standard DBIO combinators.
Step 2 is a profile like
AsyncPostgresProfile extends SqlProfile that can compile the supported basic operations (defined in
RelationalProfile) to asynchronous actions. Since you need to use the SQL code generator which is currently defined in
JdbcStatementBuilderComponent with a dependency on
JdbcProfile this will require some refactoring to pull the statement builder up to the
At this point you should be able to write a
TestDB and run Testkit on the new profile. All tests that are based on
RelationalProfile should run and pass.
The final phase is making
SqlProfile more useful. All our
SqlProfile implementations at the moment implement
JdbcProfile, so there was no real need to make
SqlProfile useful. It should be possible to refactor many operations from