MCPcopy Index your code
hub / github.com/rilldata/rill / FindProjects

Method FindProjects

admin/database/postgres/postgres.go:221–238  ·  view source on GitHub ↗
(ctx context.Context, afterID string, limit int)

Source from the content-addressed store, hash-verified

219}
220
221func (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
240func (c *connection) FindProjectsByVersion(ctx context.Context, version, afterID string, limit int) ([]*database.Project, error) {
241 var qry strings.Builder

Callers

nothing calls this directly

Calls 5

getDBMethod · 0.95
projectsFromDTOsMethod · 0.95
parseErrFunction · 0.85
SelectContextMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected