MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / installsFor

Function installsFor

internal/instructions/store.go:201–218  ·  view source on GitHub ↗
(ctx context.Context, q queryer, id int64)

Source from the content-addressed store, hash-verified

199}
200
201func installsFor(ctx context.Context, q queryer, id int64) ([]Install, error) {
202 rows, err := q.QueryContext(ctx, `SELECT id, app, level, project_dir, target_path, link_kind, created_at FROM instruction_installs WHERE instruction_id = ? ORDER BY id`, id)
203 if err != nil {
204 return nil, fmt.Errorf("instructions: list installs: %w", err)
205 }
206 defer rows.Close()
207 var out []Install
208 for rows.Next() {
209 var ins Install
210 var created string
211 if err := rows.Scan(&ins.ID, &ins.App, &ins.Level, &ins.ProjectDir, &ins.TargetPath, &ins.LinkKind, &created); err != nil {
212 return nil, fmt.Errorf("instructions: scan install: %w", err)
213 }
214 ins.CreatedAt = parseTime(created)
215 out = append(out, ins)
216 }
217 return out, rows.Err()
218}
219
220// nameExists reports whether a row with name exists, optionally excluding an id.
221func nameExists(ctx context.Context, q queryer, name string, excludeID int64) (bool, error) {

Callers 3

ListWithInstallsMethod · 0.85
getTxFunction · 0.85
UpdateMethod · 0.85

Calls 2

parseTimeFunction · 0.85
QueryContextMethod · 0.80

Tested by

no test coverage detected