-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store Analytics Events as JSON Blobs in Room (#1051)
* Introduce AnalyticsEventBlob to project. Stub out serialize method. DRY up AnalyticsClient Blob serialization code. Remove AnalyticsEvent table. Remove unecessary annotation. Clean up AnalyticsClient internals. Update test to fit new serialization model. Remove keys that are no longer needed. Tweak variable names. Update naming. Fix detekt lint errors. Push schema file. * Fix rebase errors. * Add schema 7 to project. * Update unit tests to assert new fields are present. * Implement AnalyticsClient default constructor. * Add comment string. * Make id val instead of var in AnalyticsEventBlob. * Add missing RestrictTo annotation. * Remove unnecessary annotation.
1 parent
4bce04b
commit 681435c
Showing
13 changed files
with
420 additions
and
361 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
BraintreeCore/schemas/com.braintreepayments.api.AnalyticsDatabase/7.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 7, | ||
"identityHash": "065b039e1e06945e854870d014261016", | ||
"entities": [ | ||
{ | ||
"tableName": "analytics_event_blob", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`json_string` TEXT NOT NULL, `_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)", | ||
"fields": [ | ||
{ | ||
"fieldPath": "jsonString", | ||
"columnName": "json_string", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "_id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"columnNames": [ | ||
"_id" | ||
], | ||
"autoGenerate": true | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
} | ||
], | ||
"views": [], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '065b039e1e06945e854870d014261016')" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.