mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
draft of idb store for fragments
This commit is contained in:
parent
749bdadf74
commit
06d2d2e198
@ -10,10 +10,12 @@ function createStores(db) {
|
|||||||
db.createObjectStore("session", {keyPath: "key"});
|
db.createObjectStore("session", {keyPath: "key"});
|
||||||
// any way to make keys unique here? (just use put?)
|
// any way to make keys unique here? (just use put?)
|
||||||
db.createObjectStore("roomSummary", {keyPath: "roomId"});
|
db.createObjectStore("roomSummary", {keyPath: "roomId"});
|
||||||
|
|
||||||
|
db.createObjectStore("timelineFragments", {keyPath: ["roomId", "id"]});
|
||||||
// needs roomId separate because it might hold a gap and no event
|
// needs roomId separate because it might hold a gap and no event
|
||||||
const timeline = db.createObjectStore("roomTimeline", {keyPath: ["roomId", "sortKey"]});
|
const timelineEvents = db.createObjectStore("timelineEvents", {keyPath: ["event.room_id", "fragmentId", "sortKey"]});
|
||||||
timeline.createIndex("byEventId", [
|
timelineEvents.createIndex("byEventId", [
|
||||||
"roomId",
|
"event.room_id",
|
||||||
"event.event_id"
|
"event.event_id"
|
||||||
], {unique: true});
|
], {unique: true});
|
||||||
|
|
||||||
@ -29,4 +31,4 @@ function createStores(db) {
|
|||||||
// "event.state_key"
|
// "event.state_key"
|
||||||
// ]});
|
// ]});
|
||||||
// roomMembers.createIndex("byName", ["room_id", "content.name"]);
|
// roomMembers.createIndex("byName", ["room_id", "content.name"]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user