all repos — searchix @ 3be8a83d4c44f7e21277abde2da69b54111c1c1a

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix: error setting up programs DB

Alan Pearce
commit

3be8a83d4c44f7e21277abde2da69b54111c1c1a

parent

180d4cf8780230e5af64e1750a2b2e4b87d519d3

1 file changed, 4 insertions(+), 4 deletions(-)

changed files
M internal/programs/programs.gointernal/programs/programs.go
@@ -72,14 +72,14 @@
outPath := strings.Trim(strings.TrimSpace(string(out)), "\"") p.logger.Debug("got output path", "outputPath", outPath) - _, err = p.db.ExecContext(ctx, "ATTACH DATABASE ? AS input", outPath) + _, err = p.db.ExecContext(ctx, "DROP TABLE IF EXISTS programs") if err != nil { - return fault.Wrap(err, fmsg.With("failed to attach nix-store programs database")) + return fault.Wrap(err, fmsg.With("failed to drop programs table")) } - _, err = p.db.ExecContext(ctx, "DROP TABLE IF EXISTS programs") + _, err = p.db.ExecContext(ctx, "ATTACH DATABASE ? AS input", outPath) if err != nil { - return fault.Wrap(err, fmsg.With("failed to drop programs table")) + return fault.Wrap(err, fmsg.With("failed to attach nix-store programs database")) } _, err = p.db.ExecContext(ctx, `