Skip to content

ORM: Pluck and Chunk helpers #17

@devituz

Description

@devituz

Goal

Add Pluck (fetch a single column into a slice) and Chunk (cursor-friendly batched fetch) to orm.Query[T]. Mirrors Eloquent's APIs.

Acceptance criteria

  • Pluck[V any](ctx, query, col string) ([]V, error) returns a typed slice
  • Chunk[T any](ctx, query, size int, fn func([]T) error) error streams batches
  • Both use a single SQL statement per batch (no per-row queries)
  • Tests against SQLite covering empty, partial-last-batch, and error-mid-stream cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions