chore: adjust store test for mysql

This commit is contained in:
Steven
2023-09-29 09:15:54 +08:00
parent 255254eb69
commit 87ddeb2c79
13 changed files with 359 additions and 163 deletions

View File

@ -18,13 +18,17 @@ type Driver struct {
func NewDriver(profile *profile.Profile) (store.Driver, error) {
db, err := sql.Open("mysql", profile.DSN)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "failed to open db: %s", profile.DSN)
}
driver := Driver{db: db, profile: profile}
return &driver, nil
}
func (d *Driver) GetDB() *sql.DB {
return d.db
}
func (d *Driver) Vacuum(ctx context.Context) error {
tx, err := d.db.BeginTx(ctx, nil)
if err != nil {