(ctx context.Context, afterID string, limit int)
| 219 | } |
| 220 | |
| 221 | func (c *connection) FindProjects(ctx context.Context, afterID string, limit int) ([]*database.Project, error) { |
| 222 | var qry strings.Builder |
| 223 | var args []any |
| 224 | qry.WriteString("SELECT p.* FROM projects p ") |
| 225 | if afterID != "" { |
| 226 | qry.WriteString("WHERE p.id > $1 ORDER BY p.id LIMIT $2") |
| 227 | args = []any{afterID, limit} |
| 228 | } else { |
| 229 | qry.WriteString("ORDER BY p.id LIMIT $1") |
| 230 | args = []any{limit} |
| 231 | } |
| 232 | var res []*projectDTO |
| 233 | err := c.getDB(ctx).SelectContext(ctx, &res, qry.String(), args...) |
| 234 | if err != nil { |
| 235 | return nil, parseErr("projects", err) |
| 236 | } |
| 237 | return c.projectsFromDTOs(res) |
| 238 | } |
| 239 | |
| 240 | func (c *connection) FindProjectsByVersion(ctx context.Context, version, afterID string, limit int) ([]*database.Project, error) { |
| 241 | var qry strings.Builder |
nothing calls this directly
no test coverage detected