-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public final class LocalCampaignTrackDbHelper extends SQLiteOpenHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLocalCampaignTrackDbHelper.LocalCampaignEntry
-
Field Summary
Fields Modifier and Type Field Description public final static intDATABASE_VERSIONpublic final static StringDATABASE_NAME
-
Constructor Summary
Constructors Constructor Description LocalCampaignTrackDbHelper(Context context)Constructor for the LocalCampaignTrackDbHelper
-
Method Summary
Modifier and Type Method Description voidonCreate(SQLiteDatabase sqLiteDatabase)Called when the database is created for the first time. voidonUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion)Called when the database needs to be upgraded. voidmigrateToSchemaVersion3(SQLiteDatabase sqLiteDatabase)Migration of the database schema to version 3This add a new column custom_user_id to the view events table and recreate the table LocalCampaignsSQLTracker with the new unique constraint. StringgetTableAsString(SQLiteDatabase db)Helper function that parses a given table into a stringand returns it for easy printing. -
Methods inherited from class android.database.sqlite.SQLiteOpenHelper
close, getDatabaseName, getReadableDatabase, getWritableDatabase, onConfigure, onCreate, onDowngrade, onOpen, onUpgrade, setIdleConnectionTimeout, setLookasideConfig, setOpenParams, setWriteAheadLoggingEnabled -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LocalCampaignTrackDbHelper
LocalCampaignTrackDbHelper(Context context)
Constructor for the LocalCampaignTrackDbHelper- Parameters:
context- the context
-
-
Method Detail
-
onCreate
void onCreate(SQLiteDatabase sqLiteDatabase)
Called when the database is created for the first time.
- Parameters:
sqLiteDatabase- The database.
-
onUpgrade
void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion)
Called when the database needs to be upgraded.
- Parameters:
sqLiteDatabase- The database.oldVersion- The old database version.newVersion- The new database version.
-
migrateToSchemaVersion3
void migrateToSchemaVersion3(SQLiteDatabase sqLiteDatabase)
Migration of the database schema to version 3This add a new column custom_user_id to the view events table and recreate the table LocalCampaignsSQLTracker with the new unique constraint.
- Parameters:
sqLiteDatabase- The database.
-
getTableAsString
String getTableAsString(SQLiteDatabase db)
Helper function that parses a given table into a stringand returns it for easy printing. The string consists ofthe table name and then each row is iterated through withcolumn_name: value pairs printed out.
- Parameters:
db- the database to get the table from
-
-
-
-