From 29b1576b19a30c35f2c253f1d79f25de28d90f70 Mon Sep 17 00:00:00 2001 From: WinPooh32 Date: Mon, 8 Jan 2024 17:03:33 +1000 Subject: [PATCH] Add aggregation section --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index e6cb234..2a25ff1 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,21 @@ It does: - [SQL](https://pkg.go.dev/github.com/WinPooh32/norm/driver/sql) - MongoDB (TODO) +## Aggregation + +For using in-memory aggregation functions model type must implement this interface: + +```go +type Keyer[K comparable] interface { + Key() K +} +``` + +Available functions: + +- [Lookup](https://pkg.go.dev/github.com/WinPooh32/norm#Lookup) - left outer join +- [Group](https://pkg.go.dev/github.com/WinPooh32/norm#Group) - values grouping + ## Examples ### SQL