mirror of
https://github.com/pushbits/server.git
synced 2025-07-31 07:09:28 +02:00
getApplication testing
This commit is contained in:
parent
ef5409eb35
commit
46dd19b07d
3 changed files with 94 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/pushbits/server/internal/authentication/credentials"
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/database"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
)
|
||||
|
||||
// GetEmptyDatabase returns an empty sqlite database object
|
||||
|
@ -11,3 +12,15 @@ func GetEmptyDatabase() (*database.Database, error) {
|
|||
cm := credentials.CreateManager(false, configuration.CryptoConfig{})
|
||||
return database.Create(cm, "sqlite3", "pushbits-test.db")
|
||||
}
|
||||
|
||||
// AddApplicationsToDb inserts the applications apps into the database db
|
||||
func AddApplicationsToDb(db *database.Database, apps []*model.Application) error {
|
||||
for _, app := range apps {
|
||||
err := db.CreateApplication(app)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue