Versions in this module Expand all Collapse all v0 v0.14.0 Dec 18, 2024 Changes in this version + type Database struct + AccountData tables.AccountData + BackwardExtremities tables.BackwardsExtremities + CurrentRoomState tables.CurrentRoomState + DB *sql.DB + Filter tables.Filter + Ignores tables.Ignores + Invites tables.Invites + Memberships tables.Memberships + NotificationData tables.NotificationData + OutputEvents tables.Events + Peeks tables.Peeks + Presence tables.Presence + Receipts tables.Receipts + Relations tables.Relations + SendToDevice tables.SendToDevice + Topology tables.Topology + Writer sqlutil.Writer + func (d *Database) AddInviteEvent(ctx context.Context, inviteEvent *rstypes.HeaderedEvent) (sp types.StreamPosition, err error) + func (d *Database) AddPeek(ctx context.Context, roomID, userID, deviceID string) (sp types.StreamPosition, err error) + func (d *Database) CleanSendToDeviceUpdates(ctx context.Context, userID, deviceID string, before types.StreamPosition) (err error) + func (d *Database) DeletePeek(ctx context.Context, roomID, userID, deviceID string) (sp types.StreamPosition, err error) + func (d *Database) DeletePeeks(ctx context.Context, roomID, userID string) (sp types.StreamPosition, err error) + func (d *Database) Events(ctx context.Context, eventIDs []string) ([]*rstypes.HeaderedEvent, error) + func (d *Database) GetFilter(ctx context.Context, target *synctypes.Filter, localpart string, ...) error + func (d *Database) GetPresences(ctx context.Context, userIDs []string) ([]*types.PresenceInternal, error) + func (d *Database) IgnoresForUser(ctx context.Context, userID string) (*types.IgnoredUsers, error) + func (d *Database) NewDatabaseSnapshot(ctx context.Context) (*DatabaseTransaction, error) + func (d *Database) NewDatabaseTransaction(ctx context.Context) (*DatabaseTransaction, error) + func (d *Database) PurgeRoom(ctx context.Context, roomID string) error + func (d *Database) PurgeRoomState(ctx context.Context, roomID string) error + func (d *Database) PutFilter(ctx context.Context, localpart string, filter *synctypes.Filter) (string, error) + func (d *Database) ReIndex(ctx context.Context, limit, afterID int64) (map[int64]rstypes.HeaderedEvent, error) + func (d *Database) RedactEvent(ctx context.Context, redactedEventID string, ...) error + func (d *Database) RedactRelations(ctx context.Context, roomID, redactedEventID string) error + func (d *Database) RetireInviteEvent(ctx context.Context, inviteEventID string) (sp types.StreamPosition, err error) + func (d *Database) SelectContextAfterEvent(ctx context.Context, id int, roomID string, filter *synctypes.RoomEventFilter) (int, []*rstypes.HeaderedEvent, error) + func (d *Database) SelectContextBeforeEvent(ctx context.Context, id int, roomID string, filter *synctypes.RoomEventFilter) ([]*rstypes.HeaderedEvent, error) + func (d *Database) SelectContextEvent(ctx context.Context, roomID, eventID string) (int, rstypes.HeaderedEvent, error) + func (d *Database) SelectMembershipForUser(ctx context.Context, roomID, userID string, pos int64) (membership string, topologicalPos int64, err error) + func (d *Database) SelectMemberships(ctx context.Context, roomID string, pos types.TopologyToken, ...) (eventIDs []string, err error) + func (d *Database) StoreNewSendForDeviceMessage(ctx context.Context, userID, deviceID string, ...) (newPos types.StreamPosition, err error) + func (d *Database) StoreReceipt(ctx context.Context, roomId, receiptType, userId, eventId string, ...) (pos types.StreamPosition, err error) + func (d *Database) StreamEventsToEvents(ctx context.Context, device *userapi.Device, in []types.StreamEvent, ...) []*rstypes.HeaderedEvent + func (d *Database) UpdateIgnoresForUser(ctx context.Context, userID string, ignores *types.IgnoredUsers) error + func (d *Database) UpdatePresence(ctx context.Context, userID string, presence types.Presence, statusMsg *string, ...) (types.StreamPosition, error) + func (d *Database) UpdateRelations(ctx context.Context, event *rstypes.HeaderedEvent) error + func (d *Database) UpsertAccountData(ctx context.Context, userID, roomID, dataType string) (sp types.StreamPosition, err error) + func (d *Database) UpsertRoomUnreadNotificationCounts(ctx context.Context, userID, roomID string, ...) (pos types.StreamPosition, err error) + func (d *Database) WriteEvent(ctx context.Context, ev *rstypes.HeaderedEvent, ...) (pduPosition types.StreamPosition, returnErr error) + type DatabaseTransaction struct + func (d *DatabaseTransaction) AllJoinedUsersInRoom(ctx context.Context, roomIDs []string) (map[string][]string, error) + func (d *DatabaseTransaction) AllJoinedUsersInRooms(ctx context.Context) (map[string][]string, error) + func (d *DatabaseTransaction) AllPeekingDevicesInRooms(ctx context.Context) (map[string][]types.PeekingDevice, error) + func (d *DatabaseTransaction) BackwardExtremitiesForRoom(ctx context.Context, roomID string) (backwardExtremities map[string][]string, err error) + func (d *DatabaseTransaction) Commit() error + func (d *DatabaseTransaction) CurrentState(ctx context.Context, roomID string, stateFilterPart *synctypes.StateFilter, ...) ([]*rstypes.HeaderedEvent, error) + func (d *DatabaseTransaction) EventPositionInTopology(ctx context.Context, eventID string) (types.TopologyToken, error) + func (d *DatabaseTransaction) Events(ctx context.Context, eventIDs []string) ([]*rstypes.HeaderedEvent, error) + func (d *DatabaseTransaction) GetAccountDataInRange(ctx context.Context, userID string, r types.Range, ...) (map[string][]string, types.StreamPosition, error) + func (d *DatabaseTransaction) GetBackwardTopologyPos(ctx context.Context, events []*rstypes.HeaderedEvent) (types.TopologyToken, error) + func (d *DatabaseTransaction) GetEventsInTopologicalRange(ctx context.Context, from, to *types.TopologyToken, roomID string, ...) (events []types.StreamEvent, start, end types.TopologyToken, err error) + func (d *DatabaseTransaction) GetPresences(ctx context.Context, userIDs []string) ([]*types.PresenceInternal, error) + func (d *DatabaseTransaction) GetRoomReceipts(ctx context.Context, roomIDs []string, streamPos types.StreamPosition) ([]types.OutputReceiptEvent, error) + func (d *DatabaseTransaction) GetRoomSummary(ctx context.Context, roomID, userID string) (*types.Summary, error) + func (d *DatabaseTransaction) GetStateDeltas(ctx context.Context, device *userapi.Device, r types.Range, userID string, ...) (deltas []types.StateDelta, joinedRoomsIDs []string, err error) + func (d *DatabaseTransaction) GetStateDeltasForFullStateSync(ctx context.Context, device *userapi.Device, r types.Range, userID string, ...) ([]types.StateDelta, []string, error) + func (d *DatabaseTransaction) GetStateEvent(ctx context.Context, roomID, evType, stateKey string) (*rstypes.HeaderedEvent, error) + func (d *DatabaseTransaction) GetStateEventsForRoom(ctx context.Context, roomID string, stateFilter *synctypes.StateFilter) (stateEvents []*rstypes.HeaderedEvent, err error) + func (d *DatabaseTransaction) GetUserUnreadNotificationCountsForRooms(ctx context.Context, userID string, rooms map[string]string) (map[string]*eventutil.NotificationData, error) + func (d *DatabaseTransaction) InviteEventsInRange(ctx context.Context, targetUserID string, r types.Range) (map[string]*rstypes.HeaderedEvent, map[string]*rstypes.HeaderedEvent, ...) + func (d *DatabaseTransaction) MaxStreamPositionForAccountData(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForInvites(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForNotificationData(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForPDUs(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForPresence(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForReceipts(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForRelations(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MaxStreamPositionForSendToDeviceMessages(ctx context.Context) (types.StreamPosition, error) + func (d *DatabaseTransaction) MembershipCount(ctx context.Context, roomID, membership string, pos types.StreamPosition) (int, error) + func (d *DatabaseTransaction) PeeksInRange(ctx context.Context, userID, deviceID string, r types.Range) (peeks []types.Peek, err error) + func (d *DatabaseTransaction) PositionInTopology(ctx context.Context, eventID string) (pos types.StreamPosition, spos types.StreamPosition, err error) + func (d *DatabaseTransaction) PresenceAfter(ctx context.Context, after types.StreamPosition, filter synctypes.EventFilter) (map[string]*types.PresenceInternal, error) + func (d *DatabaseTransaction) RecentEvents(ctx context.Context, roomIDs []string, r types.Range, ...) (map[string]types.RecentEvents, error) + func (d *DatabaseTransaction) RelationsFor(ctx context.Context, roomID, eventID, relType, eventType string, ...) (events []types.StreamEvent, prevBatch, nextBatch string, err error) + func (d *DatabaseTransaction) Rollback() error + func (d *DatabaseTransaction) RoomIDsWithMembership(ctx context.Context, userID string, membership string) ([]string, error) + func (d *DatabaseTransaction) RoomReceiptsAfter(ctx context.Context, roomIDs []string, streamPos types.StreamPosition) (types.StreamPosition, []types.OutputReceiptEvent, error) + func (d *DatabaseTransaction) SendToDeviceUpdatesForSync(ctx context.Context, userID, deviceID string, from, to types.StreamPosition) (types.StreamPosition, []types.SendToDeviceEvent, error) + func (d *DatabaseTransaction) SharedUsers(ctx context.Context, userID string, otherUserIDs []string) ([]string, error) + func (d *DatabaseTransaction) StreamToTopologicalPosition(ctx context.Context, roomID string, streamPos types.StreamPosition, ...) (types.TopologyToken, error)