
The sample app defines a TodoItemDatabase class for this purpose. This class centralizes query logic and simplifies the management of database initialization, making it easier to refactor or expand data operations as the app grows. Create a database access classĪ database wrapper class abstracts the data access layer from the rest of the app. For more information about SQLiteOpenFlags, see Opening A New Database Connection on. You may need to specify different flags depending on how your database will be used.

ProtectionCompleteUnlessOpen: The file is encrypted until it's opened but is then accessible even if the user locks the device.ProtectionComplete: The file is encrypted and inaccessible while the device is locked.SharedCache: The connection will participate in the shared cache, if it's enabled.

ReadWrite: The connection can read and write data.PrivateCache: The connection will not participate in the shared cache, even if it's enabled.


Public const string DatabaseFilename = "TodoSQLite.db3" The sample project includes a Constants.cs file that provides common configuration data: public static class Constants In addition to sqlite-net-pcl, you temporarily need to install the underlying dependency that exposes SQLite on each platform:Ĭonfiguration data, such as database filename and path, can be stored as constants in your app. SQLite.NET is a third-party library that's supported from the praeclarum/sqlite-net repo.
