Skip to content

Commit

Permalink
Remove unused GetRevision query (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco6 authored Sep 2, 2024
1 parent 50435e5 commit 132be15
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
21 changes: 0 additions & 21 deletions pkg/kine/drivers/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ type Generic struct {
LastInsertID bool
DB *prepared.DB
GetCurrentSQL string
GetRevisionSQL string
RevisionSQL string
ListRevisionStartSQL string
GetRevisionAfterSQL string
Expand Down Expand Up @@ -224,12 +223,6 @@ func Open(ctx context.Context, driverName, dataSourceName string, paramCharacter
return &Generic{
DB: prepared.New(db),

GetRevisionSQL: q(fmt.Sprintf(`
SELECT
%s
FROM kine kv
WHERE kv.id = ?`, columns), paramCharacter, numbered),

GetCurrentSQL: q(fmt.Sprintf(listSQL, ""), paramCharacter, numbered),
ListRevisionStartSQL: q(fmt.Sprintf(listSQL, "AND mkv.id <= ?"), paramCharacter, numbered),
GetRevisionAfterSQL: q(revisionAfterSQL, paramCharacter, numbered),
Expand Down Expand Up @@ -626,20 +619,6 @@ func (d *Generic) GetCompactRevision(ctx context.Context) (int64, int64, error)
return compact.Int64, target.Int64, err
}

func (d *Generic) GetRevision(ctx context.Context, revision int64) (*sql.Rows, error) {
var err error
getRevisionCnt.Add(ctx, 1)
ctx, span := otelTracer.Start(ctx, fmt.Sprintf("%s.get_revision", otelName))
defer func() {
span.RecordError(err)
span.End()
}()
span.SetAttributes(attribute.Int64("revision", revision))

result, err := d.query(ctx, "get_revision_sql", d.GetRevisionSQL, revision)
return result, err
}

func (d *Generic) DeleteRevision(ctx context.Context, revision int64) error {
var err error
deleteRevCnt.Add(ctx, 1)
Expand Down
1 change: 0 additions & 1 deletion pkg/kine/logstructured/sqllog/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ type Dialect interface {
After(ctx context.Context, rev, limit int64) (*sql.Rows, error)
Insert(ctx context.Context, key string, create, delete bool, createRevision, previousRevision int64, ttl int64, value, prevValue []byte) (int64, error)
Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)
GetRevision(ctx context.Context, revision int64) (*sql.Rows, error)
DeleteRevision(ctx context.Context, revision int64) error
GetCompactRevision(ctx context.Context) (int64, int64, error)
Compact(ctx context.Context, revision int64) error
Expand Down

0 comments on commit 132be15

Please sign in to comment.