Pudu programming language
Menu
API reference

Std.Db.Store.groupedBy

1 declaration

fn

groupedBy: &Std.Db.Store.Stored[T] -> &Std.Db.Driver.Rows -> Str -> Result[Map[Str, Array[T]], Std.Db.Store.StoreError]

This is a callable function.

What it does

What belongs to several parents, as a map from each parent's key to what

belongs to it.

This is the shape that matters. Loading what belongs to one parent is

loading for a list of one, so the batched form is the ordinary form and the

form that issues a query per parent is the one somebody has to write a loop

to produce. Offering both as peers is how the slow one becomes the default.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.Db.StoreSearch related declarations