Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/poolflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ func (l *Flags) SetFlags(fs *flag.FlagSet) {
fs.StringVar(&l.defaultHead, "use", defaultHead, "commit to use, i.e., pool, pool@branch, or pool@commit")
}

func (f *Flags) HEAD() (*dbid.Commitish, error) {
func (f *Flags) HEAD() (*dbid.Committish, error) {
if f.defaultHead == "" {
return nil, errors.New(`pool and branch are unspecified
(specify with -use flag or "super db use" command)`)
}
c, err := dbid.ParseCommitish(f.defaultHead)
c, err := dbid.ParseCommittish(f.defaultHead)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/internal/dbmanage/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func newBranch(c Config, pool *pools.Config, db dbapi.Interface, logger *zap.Log

func (b *branch) run(ctx context.Context) error {
b.logger.Debug("compaction started")
head := dbid.Commitish{Pool: b.pool.Name, Branch: b.config.Branch}
head := dbid.Committish{Pool: b.pool.Name, Branch: b.config.Branch}
it, err := newObjectIterator(ctx, b.db, &head)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/internal/dbmanage/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type objectIterator struct {
unmarshaler *sup.UnmarshalBSUPContext
}

func newObjectIterator(ctx context.Context, db api.Interface, head *dbid.Commitish) (*objectIterator, error) {
func newObjectIterator(ctx context.Context, db api.Interface, head *dbid.Committish) (*objectIterator, error) {
query := fmt.Sprintf(iteratorQuery, head.Pool, head.Branch, head.Pool, head.Branch)
q, err := db.Query(ctx, srcfiles.Plain(query))
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions cmd/super/db/use/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,36 @@ func (c *Command) Run(args []string) error {
}
return nil
}
commitish, err := dbid.ParseCommitish(args[0])
committish, err := dbid.ParseCommittish(args[0])
if err != nil {
return err
}
if commitish.Pool == "" {
if committish.Pool == "" {
head, err := c.poolFlags.HEAD()
if err != nil {
return errors.New("default pool unset")
}
commitish.Pool = head.Pool
committish.Pool = head.Pool
}
if commitish.Branch == "" {
commitish.Branch = "main"
if committish.Branch == "" {
committish.Branch = "main"
}
db, err := c.DBFlags.Open(ctx)
if err != nil {
return err
}
poolID, err := db.PoolID(ctx, commitish.Pool)
poolID, err := db.PoolID(ctx, committish.Pool)
if err != nil {
return err
}
if _, err = db.CommitObject(ctx, poolID, commitish.Branch); err != nil {
if _, err = db.CommitObject(ctx, poolID, committish.Branch); err != nil {
return err
}
if err := poolflags.WriteHead(commitish.Pool, commitish.Branch); err != nil {
if err := poolflags.WriteHead(committish.Pool, committish.Branch); err != nil {
return err
}
if !c.DBFlags.Quiet {
fmt.Printf("Switched to branch %q on pool %q\n", commitish.Branch, commitish.Pool)
fmt.Printf("Switched to branch %q on pool %q\n", committish.Branch, committish.Pool)
}
return nil
}
4 changes: 2 additions & 2 deletions cmd/super/db/vacate/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (c *Command) Run(args []string) error {
if len(args) > 0 {
ts, err = nano.ParseRFC3339Nano([]byte(args[0]))
} else {
ts, err = c.getTsFromCommitish(ctx, db, at)
ts, err = c.getTsFromCommittish(ctx, db, at)
}
if err != nil {
return err
Expand All @@ -85,7 +85,7 @@ func (c *Command) Run(args []string) error {
return nil
}

func (c *Command) getTsFromCommitish(ctx context.Context, db api.Interface, at *dbid.Commitish) (nano.Ts, error) {
func (c *Command) getTsFromCommittish(ctx context.Context, db api.Interface, at *dbid.Committish) (nano.Ts, error) {
commit, err := api.GetCommit(ctx, db, at.Pool, at.Branch)
if err != nil {
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *compiler) NewQuery(rctx *runtime.Context, ast *parser.AST, readers []vi
return CompileWithAST(rctx, ast, c.env, true, parallelism, readers)
}

func (l *compiler) NewDeleteQuery(rctx *runtime.Context, ast *parser.AST, head *dbid.Commitish) (runtime.DeleteQuery, error) {
func (l *compiler) NewDeleteQuery(rctx *runtime.Context, ast *parser.AST, head *dbid.Committish) (runtime.DeleteQuery, error) {
if err := ast.ConvertToDeleteWhere(head.Pool, head.Branch); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func bundleOutputs(rctx *runtime.Context, outputs map[string]vio.Puller, chans *
}
}

func VectorFilterCompile(rctx *runtime.Context, query string, env *exec.Environment, head *dbid.Commitish) (sbuf.Puller, error) {
func VectorFilterCompile(rctx *runtime.Context, query string, env *exec.Environment, head *dbid.Committish) (sbuf.Puller, error) {
// Eventually the semantic analyzer + rungen will resolve the pool but
// for now just do this manually.
if !env.IsAttached() {
Expand Down
Loading
Loading