mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 14:18:12 +00:00
18 lines
259 B
Go
18 lines
259 B
Go
package common
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/go-pg/pg/v10/orm"
|
|
)
|
|
|
|
func GenerateEmbed(qr *orm.Query, embed string) *orm.Query{
|
|
if embed != "" {
|
|
rels := strings.Split(embed, ",")
|
|
for _, rel := range rels {
|
|
qr = qr.Relation(rel)
|
|
}
|
|
}
|
|
return qr
|
|
}
|