21 lines
462 B
Go
21 lines
462 B
Go
package otter
|
|
|
|
import (
|
|
"context"
|
|
"git.dragse.it/anthrove/otter-space-sdk/v2/pkg/database"
|
|
"git.dragse.it/anthrove/otter-space-sdk/v2/pkg/models"
|
|
)
|
|
|
|
func ConnectToDatabase(ctx context.Context, config models.DatabaseConfig) (database.OtterSpace, error) {
|
|
var otterSpace database.OtterSpace
|
|
var err error
|
|
|
|
otterSpace = database.NewPostgresqlConnection()
|
|
err = otterSpace.Connect(ctx, config)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return otterSpace, err
|
|
}
|