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

Method FindProjectsByVersion

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

Source from the content-addressed store, hash-verified

238}
239
240func (c *connection) FindProjectsByVersion(ctx context.Context, version, afterID string, limit int) ([]*database.Project, error) {
241 var qry strings.Builder
242 var args []any
243 qry.WriteString("SELECT p.* FROM projects p WHERE p.prod_version = $1 ")
244 if afterID != "" {
245 qry.WriteString("AND p.id > $2 ORDER BY p.id LIMIT $3")
246 args = []any{version, afterID, limit}
247 } else {
248 qry.WriteString("ORDER BY p.id LIMIT $2")
249 args = []any{version, limit}
250 }
251 var res []*projectDTO
252 err := c.getDB(ctx).SelectContext(ctx, &res, qry.String(), args...)
253 if err != nil {
254 return nil, parseErr("projects", err)
255 }
256 return c.projectsFromDTOs(res)
257}
258
259func (c *connection) FindProjectPathsByPattern(ctx context.Context, namePattern, afterName string, limit int) ([]string, error) {
260 var res []string

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