Plantings backend: plop CRUD, derived counts, removed_at (#14)
Build image / build-and-push (push) Successful in 7s

Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #33.
This commit is contained in:
2026-07-19 02:41:22 +00:00
committed by steve
parent e4505ed9a7
commit f4e5dab98c
10 changed files with 990 additions and 9 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ func scanPlant(s scanner) (*domain.Plant, error) {
// ListReferencedPlants returns the distinct plants used by a garden's active
// plantings — the catalog subset the editor needs to render them. Always a
// non-nil slice (empty until plantings exist, #14). Full plant CRUD/seeding is
// #12; this is only the /full read side.
// non-nil slice (empty when the garden has no active plantings). This is the
// /full read side; full plant CRUD/seeding lives in plants.go / plantings.go.
func (d *DB) ListReferencedPlants(ctx context.Context, gardenID int64) ([]domain.Plant, error) {
rows, err := d.sql.QueryContext(ctx,
`SELECT DISTINCT `+qualifyColumns("p", plantColumns)+` FROM plants p