mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
mas: added localpart_external_ids table
This commit is contained in:
parent
e1dfe62b20
commit
150be588f5
8 changed files with 242 additions and 0 deletions
|
@ -49,6 +49,7 @@ type Database struct {
|
|||
Notifications tables.NotificationTable
|
||||
Pushers tables.PusherTable
|
||||
Stats tables.StatsTable
|
||||
LocalpartExternalIDs tables.LocalpartExternalIDsTable
|
||||
LoginTokenLifetime time.Duration
|
||||
ServerName spec.ServerName
|
||||
BcryptCost int
|
||||
|
@ -870,6 +871,18 @@ func (d *Database) UpsertPusher(
|
|||
})
|
||||
}
|
||||
|
||||
func (d *Database) CreateLocalpartExternalID(ctx context.Context, localpart, externalID, authProvider string) error {
|
||||
return d.LocalpartExternalIDs.Insert(ctx, nil, localpart, externalID, authProvider)
|
||||
}
|
||||
|
||||
func (d *Database) GetLocalpartForExternalID(ctx context.Context, externalID, authProvider string) (*api.LocalpartExternalID, error) {
|
||||
return d.LocalpartExternalIDs.Select(ctx, nil, externalID, authProvider)
|
||||
}
|
||||
|
||||
func (d *Database) DeleteLocalpartExternalID(ctx context.Context, externalID, authProvider string) error {
|
||||
return d.LocalpartExternalIDs.Delete(ctx, nil, externalID, authProvider)
|
||||
}
|
||||
|
||||
// GetPushers returns the pushers matching the given localpart.
|
||||
func (d *Database) GetPushers(
|
||||
ctx context.Context, localpart string, serverName spec.ServerName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue