Persisting Data in the Database
Now that your environment is ready, you’ll add a new repository to save pomo’s application data into SQLite. Currently, the application supports only the inMemory repository. When you add more repositories, you need to provide a way for your users to choose how to store data. You can do this at compile time or run time.
Providing this choice at run time makes your application more flexible, allowing users to choose which data store to use for every execution. To do this, you need to compile your application with support for all required data stores and allow the user to choose one, using command-line parameters or configuration options.
You can also compile the application with support for a specific data store, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access