chore: update db utils (#2177)

This commit is contained in:
boojack
2023-08-26 07:33:45 +08:00
committed by GitHub
parent 4af0d03e93
commit ad1822d308
10 changed files with 1016 additions and 6 deletions

View File

@ -32,9 +32,12 @@ type TestingServer struct {
func NewTestingServer(ctx context.Context, t *testing.T) (*TestingServer, error) {
profile := test.GetTestingProfile(t)
db := db.NewDB(profile)
if err := db.Open(ctx); err != nil {
if err := db.Open(); err != nil {
return nil, errors.Wrap(err, "failed to open db")
}
if err := db.Migrate(ctx); err != nil {
return nil, errors.Wrap(err, "failed to migrate db")
}
store := store.New(db.DBInstance, profile)
server, err := server.NewServer(ctx, profile, store)