Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlx package uses json tags instead of db tags when serializing objects #9

Closed
maplebed opened this issue Jun 29, 2018 · 1 comment
Closed

Comments

@maplebed
Copy link
Contributor

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"}]

@vreynolds
Copy link
Contributor

Hello,

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants