all: unwrap database.OrganizationsStore interface (#7696)

This commit is contained in:
Joe Chen
2024-03-19 19:33:43 -04:00
committed by GitHub
parent b89f20e02d
commit dd49412edd
9 changed files with 115 additions and 124 deletions

View File

@@ -123,7 +123,6 @@ func NewConnection(w logger.Writer) (*gorm.DB, error) {
}
// Initialize stores, sorted in alphabetical order.
Orgs = NewOrgsStore(db)
Perms = NewPermsStore(db)
Repos = NewReposStore(db)
TwoFactors = &twoFactorsStore{DB: db}
@@ -132,6 +131,7 @@ func NewConnection(w logger.Writer) (*gorm.DB, error) {
return db, nil
}
// DB is the database handler for the storage layer.
type DB struct {
db *gorm.DB
}
@@ -176,3 +176,7 @@ func (db *DB) LoginSources() *LoginSourcesStore {
func (db *DB) Notices() *NoticesStore {
return newNoticesStore(db.db)
}
func (db *DB) Organizations() *OrganizationsStore {
return newOrganizationsStoreStore(db.db)
}