[native] add function to initialize DatabaseQueryExecutor
Summary:
Implementing approach described in ENG-1974.
This function will be called separately in iOS and Android so this time separating function from it's call to make it easier for reviewers.
Test Plan:
- Make it possible to throw and exception on migrate() function on demand.
- Call this function.
- Build the app for both platforms
- Check if:
- getQueryExecutor() works properly -> db status = WORKABLE
- getQueryExecutor() throws exception and there is nothing in store -> db status = 'FIRST_FAILURE' and app is terminated
- getQueryExecutor() throws exception and there WORKABLE -> db status = 'FIRST_FAILURE' and app is terminated
- getQueryExecutor() throws exception and there FIRST_FAILURE -> db status = 'SECOND_FAILURE' and app proceed
- getQueryExecutor() throws exception and there SECOND_FAILURE -> db status = 'SECOND_FAILURE' and app proceed
Reviewers: marcin, tomek
Reviewed By: marcin, tomek
Subscribers: ashoat, tomek, atul
Differential Revision: https://phab.comm.dev/D5991