Copy a database

May 23, 2011 at 5:26 AM

Is there an easy way to make a copy of a database with all its tables and rows?

May 23, 2011 at 12:08 PM

There is no Copy function, no.  You would need to do someting like

if (!DoesDatabaseExist(newName))

var newDb = Database.Create(newName);

newDb.CreateTable<SomeType>();

newDb.Table<SomeType>().AddRange(oldDb.Table<SomeType>());

 

Thanks.