SimpleCloudNotifier/scnserver/db/database.go

30 lines
906 B
Go
Raw Normal View History

2022-11-13 19:17:07 +01:00
package db
import (
"context"
"gogs.mikescher.com/BlackForestBytes/goext/sq"
2022-11-13 19:17:07 +01:00
)
type DatabaseImpl interface {
2023-01-15 06:30:30 +01:00
DB() sq.DB
Migrate(ctx context.Context) error
Ping(ctx context.Context) error
BeginTx(ctx context.Context) (sq.Tx, error)
Stop(ctx context.Context) error
2022-11-18 21:25:40 +01:00
ReadSchema(ctx context.Context) (int, error)
2022-11-18 21:25:40 +01:00
WriteMetaString(ctx context.Context, key string, value string) error
WriteMetaInt(ctx context.Context, key string, value int64) error
WriteMetaReal(ctx context.Context, key string, value float64) error
WriteMetaBlob(ctx context.Context, key string, value []byte) error
ReadMetaString(ctx context.Context, key string) (*string, error)
ReadMetaInt(ctx context.Context, key string) (*int64, error)
ReadMetaReal(ctx context.Context, key string) (*float64, error)
ReadMetaBlob(ctx context.Context, key string) (*[]byte, error)
2022-12-22 10:21:10 +01:00
DeleteMeta(ctx context.Context, key string) error
2022-12-22 10:21:10 +01:00
}