You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a struct type that you pass in to one of the sqlx methods, and this struct type has separate json and db tags (or only json tags), the json tags will be honored when sending those objects to Honeycomb as db.query.args instead of the db tags. This can be confusing when specific members of the struct are omitted from json encoding but expected by the database (such as ID fields). They will appear absent in Honeycomb despite having been correctly passed to the DB.
Example:
type Foo struct {
ID int `json:"id"`
Name string `json:"-"`
Color string `json:"color"`
}
f := Foo{1, "wibbly", "green"}
db.MustExec("INSERT into foo VALUES (:id, :name, :color)", f)
The DB statement will successfully run that INSERT, but the db.query.args that shows up in Honeycomb will be [{"id":1,"color":"green"}]
The text was updated successfully, but these errors were encountered:
We will be closing this issue as it is a low priority for us. It is unlikely that we'll ever get to it, and so we'd like to set expectations accordingly.
As we enter 2022 Q1, we are trimming our OSS backlog. This is so that we can focus better on areas that are more aligned with the OpenTelemetry-focused direction of telemetry ingest for Honeycomb.
If this issue is important to you, please feel free to ping here and we can discuss/re-open.
If you have a struct type that you pass in to one of the sqlx methods, and this struct type has separate json and db tags (or only json tags), the json tags will be honored when sending those objects to Honeycomb as
db.query.args
instead of the db tags. This can be confusing when specific members of the struct are omitted from json encoding but expected by the database (such as ID fields). They will appear absent in Honeycomb despite having been correctly passed to the DB.Example:
The DB statement will successfully run that INSERT, but the
db.query.args
that shows up in Honeycomb will be[{"id":1,"color":"green"}]
The text was updated successfully, but these errors were encountered: