1

I'm developing a cross-platform app using Xamarin. Now, for data storage I'm using both Online (through API) and offline(SQLite). The app I want to develop has dynamic UI and the UI configuration is stored in DB1, while the actual data stored in another database DB2.

Now, the issue I'm facing is that I have some views created in DB1 which fetches data from DB2 as well(i.e., VIEW acroSs multiple database) and I use that VIEW to create the UI with Data from the DB1.

I did some research and found that SQLite doesn't support the VIEW across multiple database.

Can anyone help me with some workaround that can fulfill my purpose? Also, I'm open to change the DB from SQLite to any other light-weight cross-platform-oriented database.

Thanks

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
FenilS14
  • 11
  • 1
  • You can create **temp** views across multiple Sqlite dbs at runtime ( `create temp view .....`) : https://sqlite.org/lang_createview.html – SushiHangover Aug 31 '20 at 03:59
  • https://stackoverflow.com/questions/10410180/sqlite-view-across-multiple-databases – SushiHangover Aug 31 '20 at 04:05
  • Thanks @SushiHangover But is there any way I can do this without temp view ? Also, I actually want to retain that view, would it be possible with the Temporary view ? Becuase I read that the temporary view are created in the temp database which exists only for that process. – FenilS14 Aug 31 '20 at 04:35
  • No, Sqlite only supports "temp views" across attached databases. Unless you are talking huge database files (and on mobile you should not be), temp view creation speed should not be an issue, but with simple test you can determine if it is a runtime/computational/filesystem speed issue. Of course, for your mobile design, you can always merge those two DBs into one and not have to deal with runtime created views. – SushiHangover Aug 31 '20 at 05:23

0 Answers0