Versions in this module Expand all Collapse all v0 v0.14.1 Jan 16, 2025 v0.14.0 Dec 18, 2024 Changes in this version + var OptimisationNotSupportedError = errors.New("optimisation not supported") + func ExtractContentValue(ev *types.HeaderedEvent) string + type EventJSON interface + BulkSelectEventJSON func(ctx context.Context, tx *sql.Tx, eventNIDs []types.EventNID) ([]EventJSONPair, error) + InsertEventJSON func(ctx context.Context, tx *sql.Tx, eventNID types.EventNID, eventJSON []byte) error + type EventJSONPair struct + EventJSON []byte + EventNID types.EventNID + type EventStateKeys interface + BulkSelectEventStateKey func(ctx context.Context, txn *sql.Tx, eventStateKeyNIDs []types.EventStateKeyNID) (map[types.EventStateKeyNID]string, error) + BulkSelectEventStateKeyNID func(ctx context.Context, txn *sql.Tx, eventStateKeys []string) (map[string]types.EventStateKeyNID, error) + InsertEventStateKeyNID func(ctx context.Context, txn *sql.Tx, eventStateKey string) (types.EventStateKeyNID, error) + SelectEventStateKeyNID func(ctx context.Context, txn *sql.Tx, eventStateKey string) (types.EventStateKeyNID, error) + type EventTypes interface + BulkSelectEventTypeNID func(ctx context.Context, txn *sql.Tx, eventTypes []string) (map[string]types.EventTypeNID, error) + InsertEventTypeNID func(ctx context.Context, tx *sql.Tx, eventType string) (types.EventTypeNID, error) + SelectEventTypeNID func(ctx context.Context, tx *sql.Tx, eventType string) (types.EventTypeNID, error) + type Events interface + BulkSelectEventID func(ctx context.Context, txn *sql.Tx, eventNIDs []types.EventNID) (map[types.EventNID]string, error) + BulkSelectEventNID func(ctx context.Context, txn *sql.Tx, eventIDs []string) (map[string]types.EventMetadata, error) + BulkSelectSnapshotsFromEventIDs func(ctx context.Context, txn *sql.Tx, eventIDs []string) (map[types.StateSnapshotNID][]string, error) + BulkSelectStateAtEventAndReference func(ctx context.Context, txn *sql.Tx, eventNIDs []types.EventNID) ([]types.StateAtEventAndReference, error) + BulkSelectStateAtEventByID func(ctx context.Context, txn *sql.Tx, eventIDs []string) ([]types.StateAtEvent, error) + BulkSelectStateEventByID func(ctx context.Context, txn *sql.Tx, eventIDs []string, excludeRejected bool) ([]types.StateEntry, error) + BulkSelectStateEventByNID func(ctx context.Context, txn *sql.Tx, eventNIDs []types.EventNID, ...) ([]types.StateEntry, error) + BulkSelectUnsentEventNID func(ctx context.Context, txn *sql.Tx, eventIDs []string) (map[string]types.EventMetadata, error) + InsertEvent func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (types.EventNID, types.StateSnapshotNID, error) + SelectEvent func(ctx context.Context, txn *sql.Tx, eventID string) (types.EventNID, types.StateSnapshotNID, error) + SelectEventID func(ctx context.Context, txn *sql.Tx, eventNID types.EventNID) (eventID string, err error) + SelectEventRejected func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, eventID string) (rejected bool, err error) + SelectEventSentToOutput func(ctx context.Context, txn *sql.Tx, eventNID types.EventNID) (sentToOutput bool, err error) + SelectMaxEventDepth func(ctx context.Context, txn *sql.Tx, eventNIDs []types.EventNID) (int64, error) + SelectRoomNIDsForEventNIDs func(ctx context.Context, txn *sql.Tx, eventNIDs []types.EventNID) (roomNIDs map[types.EventNID]types.RoomNID, err error) + SelectRoomsWithEventTypeNID func(ctx context.Context, txn *sql.Tx, eventTypeNID types.EventTypeNID) ([]types.RoomNID, error) + UpdateEventSentToOutput func(ctx context.Context, txn *sql.Tx, eventNID types.EventNID) error + UpdateEventState func(ctx context.Context, txn *sql.Tx, eventNID types.EventNID, ...) error + type Invites interface + InsertInviteEvent func(ctx context.Context, txn *sql.Tx, inviteEventID string, roomNID types.RoomNID, ...) (bool, error) + SelectInviteActiveForUserInRoom func(ctx context.Context, txn *sql.Tx, targetUserNID types.EventStateKeyNID, ...) ([]types.EventStateKeyNID, []string, []byte, error) + UpdateInviteRetired func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) ([]string, error) + type Membership interface + DeleteMembership func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) error + InsertMembership func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) error + SelectJoinedUsers func(ctx context.Context, txn *sql.Tx, targetUserNIDs []types.EventStateKeyNID) ([]types.EventStateKeyNID, error) + SelectJoinedUsersSetForRooms func(ctx context.Context, txn *sql.Tx, roomNIDs []types.RoomNID, ...) (map[types.EventStateKeyNID]int, error) + SelectKnownUsers func(ctx context.Context, txn *sql.Tx, userID types.EventStateKeyNID, ...) ([]string, error) + SelectLocalServerInRoom func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID) (bool, error) + SelectMembershipForUpdate func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (MembershipState, error) + SelectMembershipFromRoomAndTarget func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (types.EventNID, MembershipState, bool, error) + SelectMembershipsFromRoom func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, localOnly bool) (eventNIDs []types.EventNID, err error) + SelectMembershipsFromRoomAndMembership func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (eventNIDs []types.EventNID, err error) + SelectRoomsWithMembership func(ctx context.Context, txn *sql.Tx, userID types.EventStateKeyNID, ...) ([]types.RoomNID, error) + SelectServerInRoom func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (bool, error) + UpdateForgetMembership func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) error + UpdateMembership func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (bool, error) + type MembershipState int64 + const MembershipStateInvite + const MembershipStateJoin + const MembershipStateKnock + const MembershipStateLeaveOrBan + type PreviousEvents interface + InsertPreviousEvent func(ctx context.Context, txn *sql.Tx, previousEventID string, ...) error + SelectPreviousEventExists func(ctx context.Context, txn *sql.Tx, eventID string) error + type Published interface + SelectAllPublishedRooms func(ctx context.Context, txn *sql.Tx, networkdID string, ...) ([]string, error) + SelectPublishedFromRoomID func(ctx context.Context, txn *sql.Tx, roomID string) (published bool, err error) + UpsertRoomPublished func(ctx context.Context, txn *sql.Tx, roomID, appserviceID, networkID string, ...) (err error) + type Purge interface + PurgeRoom func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, roomID string) error + type RedactionInfo struct + RedactionEventID string + RedactsEventID string + Validated bool + type Redactions interface + InsertRedaction func(ctx context.Context, txn *sql.Tx, info RedactionInfo) error + MarkRedactionValidated func(ctx context.Context, txn *sql.Tx, redactionEventID string, validated bool) error + SelectRedactionInfoByEventBeingRedacted func(ctx context.Context, txn *sql.Tx, eventID string) (*RedactionInfo, error) + SelectRedactionInfoByRedactionEventID func(ctx context.Context, txn *sql.Tx, redactionEventID string) (*RedactionInfo, error) + type ReportedEvents interface + DeleteReportedEvent func(ctx context.Context, txn *sql.Tx, reportID uint64) error + InsertReportedEvent func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (int64, error) + SelectReportedEvent func(ctx context.Context, txn *sql.Tx, reportID uint64) (api.QueryAdminEventReportResponse, error) + SelectReportedEvents func(ctx context.Context, txn *sql.Tx, from, limit uint64, backwards bool, ...) ([]api.QueryAdminEventReportsResponse, int64, error) + type RoomAliases interface + DeleteRoomAlias func(ctx context.Context, txn *sql.Tx, alias string) (err error) + InsertRoomAlias func(ctx context.Context, txn *sql.Tx, alias string, roomID string, ...) (err error) + SelectAliasesFromRoomID func(ctx context.Context, txn *sql.Tx, roomID string) ([]string, error) + SelectCreatorIDFromAlias func(ctx context.Context, txn *sql.Tx, alias string) (creatorID string, err error) + SelectRoomIDFromAlias func(ctx context.Context, txn *sql.Tx, alias string) (roomID string, err error) + type Rooms interface + BulkSelectRoomIDs func(ctx context.Context, txn *sql.Tx, roomNIDs []types.RoomNID) ([]string, error) + BulkSelectRoomNIDs func(ctx context.Context, txn *sql.Tx, roomIDs []string) ([]types.RoomNID, error) + InsertRoomNID func(ctx context.Context, txn *sql.Tx, roomID string, ...) (types.RoomNID, error) + SelectLatestEventNIDs func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID) ([]types.EventNID, types.StateSnapshotNID, error) + SelectLatestEventsNIDsForUpdate func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID) ([]types.EventNID, types.EventNID, types.StateSnapshotNID, error) + SelectRoomInfo func(ctx context.Context, txn *sql.Tx, roomID string) (*types.RoomInfo, error) + SelectRoomNID func(ctx context.Context, txn *sql.Tx, roomID string) (types.RoomNID, error) + SelectRoomNIDForUpdate func(ctx context.Context, txn *sql.Tx, roomID string) (types.RoomNID, error) + SelectRoomVersionsForRoomNIDs func(ctx context.Context, txn *sql.Tx, roomNID []types.RoomNID) (map[types.RoomNID]gomatrixserverlib.RoomVersion, error) + UpdateLatestEventNIDs func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) error + type StateBlock interface + BulkInsertStateData func(ctx context.Context, txn *sql.Tx, entries types.StateEntries) (types.StateBlockNID, error) + BulkSelectStateBlockEntries func(ctx context.Context, txn *sql.Tx, stateBlockNIDs types.StateBlockNIDs) ([][]types.EventNID, error) + type StateSnapshot interface + BulkSelectMembershipForHistoryVisibility func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID, ...) (map[string]*types.HeaderedEvent, error) + BulkSelectStateBlockNIDs func(ctx context.Context, txn *sql.Tx, stateNIDs []types.StateSnapshotNID) ([]types.StateBlockNIDList, error) + BulkSelectStateForHistoryVisibility func(ctx context.Context, txn *sql.Tx, stateSnapshotNID types.StateSnapshotNID, ...) ([]types.EventNID, error) + InsertState func(ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, ...) (stateNID types.StateSnapshotNID, err error) + type StrippedEvent struct + ContentValue string + EventType string + RoomID string + StateKey string + type UserRoomKeys interface + BulkSelectUserNIDs func(ctx context.Context, txn *sql.Tx, ...) (map[string]types.UserRoomKeyPair, error) + InsertUserRoomPrivatePublicKey func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID, ...) (ed25519.PrivateKey, error) + InsertUserRoomPublicKey func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID, ...) (ed25519.PublicKey, error) + SelectAllPublicKeysForUser func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID) (map[types.RoomNID]ed25519.PublicKey, error) + SelectUserRoomPrivateKey func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID, ...) (ed25519.PrivateKey, error) + SelectUserRoomPublicKey func(ctx context.Context, txn *sql.Tx, userNID types.EventStateKeyNID, ...) (ed25519.PublicKey, error)