com.googlecode.autoandroid.positron
Class Databases

java.lang.Object
  extended by com.googlecode.autoandroid.positron.Databases

public class Databases
extends Object


Constructor Summary
Databases(Instrumentation instrumentation)
           
 
Method Summary
 void backup()
          Backup all databases in the target context.
 void backup(String database)
          Back up the given database by copying its defining file out of the way.
 void restore()
          Restore all databases that have backups in the target context.
 void restore(String database)
          Restore the given database by copying the backup file back in place.
 void sql(String database, int... scriptsAsRawResources)
          Execute Sql scripts loaded from a raw resources.
 void sql(String database, String script)
          Execute Sql from a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Databases

public Databases(Instrumentation instrumentation)
Method Detail

backup

public void backup()
Backup all databases in the target context.


restore

public void restore()
Restore all databases that have backups in the target context.


backup

public void backup(String database)
Back up the given database by copying its defining file out of the way. This blows away any previous backup.

Parameters:
database - The database to back up.

restore

public void restore(String database)
Restore the given database by copying the backup file back in place.

Parameters:
database - The database to restore.

sql

public void sql(String database,
                int... scriptsAsRawResources)
Execute Sql scripts loaded from a raw resources.

Parameters:
database - The database to execute the sql.
scriptsAsRawResources - A varargs of R.raw.XXX resource ids of scripts to execute.

sql

public void sql(String database,
                String script)
Execute Sql from a string.

Parameters:
database - The database to execute the sql.
script - Literal sql to run.