mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Add roomserver tests (2/?) (#2445)
* Add invite table tests; move variable declarations * Add Membership table tests * Move variable declarations * Add PrevEvents table tests * Add Published table test * Add Redactions tests Fix bug in SQLite markRedactionValidatedSQL * PR comments, better readability for invite tests
This commit is contained in:
parent
1897e2f1c0
commit
6db08b2874
17 changed files with 517 additions and 66 deletions
|
@ -49,12 +49,12 @@ type publishedStatements struct {
|
|||
selectPublishedStmt *sql.Stmt
|
||||
}
|
||||
|
||||
func createPublishedTable(db *sql.DB) error {
|
||||
func CreatePublishedTable(db *sql.DB) error {
|
||||
_, err := db.Exec(publishedSchema)
|
||||
return err
|
||||
}
|
||||
|
||||
func preparePublishedTable(db *sql.DB) (tables.Published, error) {
|
||||
func PreparePublishedTable(db *sql.DB) (tables.Published, error) {
|
||||
s := &publishedStatements{
|
||||
db: db,
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ func (s *publishedStatements) SelectAllPublishedRooms(
|
|||
defer internal.CloseAndLogIfError(ctx, rows, "selectAllPublishedStmt: rows.close() failed")
|
||||
|
||||
var roomIDs []string
|
||||
var roomID string
|
||||
for rows.Next() {
|
||||
var roomID string
|
||||
if err = rows.Scan(&roomID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue