mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 23:43:11 -06:00
Self-review
This commit is contained in:
parent
b29725ab13
commit
4e0c1924a6
|
|
@ -54,7 +54,7 @@ const selectDeviceByTokenSQL = "" +
|
||||||
const deleteDeviceSQL = "" +
|
const deleteDeviceSQL = "" +
|
||||||
"DELETE FROM devices WHERE id = $1 AND localpart = $2"
|
"DELETE FROM devices WHERE id = $1 AND localpart = $2"
|
||||||
|
|
||||||
// TODO: List devices, delete device API
|
// TODO: List devices?
|
||||||
|
|
||||||
type devicesStatements struct {
|
type devicesStatements struct {
|
||||||
insertDeviceStmt *sql.Stmt
|
insertDeviceStmt *sql.Stmt
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ func (d *Database) CreateDevice(localpart, deviceID string) (dev *authtypes.Devi
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: factor out to common
|
||||||
func runTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {
|
func runTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {
|
||||||
txn, err := db.Begin()
|
txn, err := db.Begin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue