Document how the Glean.js Store works as well as the platform specific store implementations
Categories
(Data Platform and Tools :: Glean: SDK, task, P4)
Tracking
(Not tracked)
People
(Reporter: brizental, Unassigned)
Details
(Whiteboard: [glean-sdk:backlog][glean-js][docdays])
Comment 1•2 years ago
|
||
Copying your explanation from the comment:
The +
character used in Qt/QML is not to separate type information. It it not tied to any Glean specific context. Glean.js saves data in JSON format and it saves it more or less like it would be in the ping payload. In Qt/QML we use the +
character to signal that we are going one step further in a (non-existent) JSON object.
An example will make this clearer I think, so take this hypothetical data stored in JSON format.
(This is exactly how we would store a user lifetime datetime metric in the webext storage.)
{
"userLifetimeMetrics": {
"my_ping": {
"datetime": {
"glean.start_time": {
"timeUnit": "minute",
"timezone": -60,
"date": "2021-07-14T13:07:10.723Z"
}
}
}
}
}
In Qt/QML that will be stored its own table, so the userLifetimeMetrics
index is ignored. Otherwise, this is how that same data would look on SQLite:
| key | value |
| -------------------------------------------- | -------------------------- |
| "my_ping+datetime+glean.start_time+timeUnit" | "minute" |
| "my_ping+datetime+glean.start_time+timezone" | -60 |
| "my_ping+datetime+glean.start_time+date" | "2021-07-14T13:07:10.723Z" |
The Qt/QML store then transforms this into the same object as the JSON storage would, before returning. To make it opaque.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•10 months ago
|
Description
•