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

Bundebug has no output when using rows #835

Closed
aldiesel opened this issue May 25, 2023 · 1 comment · Fixed by #892
Closed

Bundebug has no output when using rows #835

aldiesel opened this issue May 25, 2023 · 1 comment · Fixed by #892

Comments

@aldiesel
Copy link

aldiesel commented May 25, 2023

I may be doing something incorrectly, but when running a select statement with the Rows method bundebug with verbose set to true does not list what the raw query was.
Bugdebug works for the Scan

This also applies to custom query hooks.

@aldiesel
Copy link
Author

Is the return of this method supposed to be q.db instead of q.conn

func (q *SelectQuery) Rows(ctx context.Context) (*sql.Rows, error) {
	if q.err != nil {
		return nil, q.err
	}

	if err := q.beforeAppendModel(ctx, q); err != nil {
		return nil, err
	}

	queryBytes, err := q.AppendQuery(q.db.fmter, q.db.makeQueryBytes())
	if err != nil {
		return nil, err
	}

	query := internal.String(queryBytes)
	return q.db.QueryContext(ctx, query)
}

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