how to update sqlite when it is embedded through assets folder?

batmacibatmaci DEMember ✭✭✭✭✭

I like to create sqlite db using DB Bowser for Sqlite and then import it as an embedded resource with the following code. But when I make changes in the db, how can I merge or update those changes without overriding the db? Is it possible at all or should I just use code first approach?

>   var sqliteFilename = "mydb.db3";
>           string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); // Documents folder
>           var path = Path.Combine(documentsPath, sqliteFilename);
> 
>             var platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
> 
>             if (!File.Exists(path))
>             {
>                 using (Stream source = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("myProject.Droid.Assets.mydb.db3"))
>                 {
>                     using (var destination = File.Create(path))
>                     {
>                         source.CopyTo(destination);
>                     }
>                 }
>             }
Sign In or Register to comment.