matthewmueller / matthewmueller/postgres
Marshal interface{} automatically
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Right now there needs to be:
meta, err := json.Marshal(t.Meta)
if err != nil {
return &t, err
}
row := db.One(`
insert into "1".tasks ("key", rate, timezone, meta)
values (:key, :rate, :timezone, :meta)
on conflict ("key", "user") do update set
rate = :rate,
timezone = :timezone,
meta = :meta
returning id
`, map[string]interface{}{
"key": t.Key,
"rate": t.Rate,
"timezone": t.Timezone,
"meta": meta,
})
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the database insert path represented in the issue and how map[string]interface{} parameters are handled. Determine the expected automatic handling for t.Meta, then verify that the shown task upsert works without the manual json.Marshal step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, postgres
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100