8110e635
database: add helpers to fetch all columns
The current solution of fetching columns based on the GraphQL context
has some limits. While probably not the solution for all use-cases, it
sometimes can be desirable to simply fetch all columns from the database
when retrieving objects.
This commit adds two simple functions doing just that. They can be used
when building SQL queries, like
query := database.SelectAll(new(model.Email))
and
rows.Scan(database.ScanAll(&email)...)
Conrad Hoffmann <ch@bitfehler.net> — 2022-09-07 10:28:57 UTC
Commit 8110e635b5af45d27d7665f26ac2bbe7105c65ed —
view raw patch
Parent(s):
12000f49
| File | Status | + | − |
|---|---|---|---|
database/sq.go
|
M | +30 |