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

How to log and get query? #41

Open
ansidev opened this issue Jun 2, 2021 · 1 comment
Open

How to log and get query? #41

ansidev opened this issue Jun 2, 2021 · 1 comment

Comments

@ansidev
Copy link

ansidev commented Jun 2, 2021

I want to get the following data:

  • Prepared statement.
  • Passed values.
  • Query with bind value.

Currently, I find no way to do these things.

@ansidev ansidev changed the title How to log and get query How to log and get query? Jun 2, 2021
@meddulla
Copy link

I use this:

func getRawQuery(query *dbr.SelectBuilder) (string, error) {
	buf := NewBuffer()
	err := query.Build(dialect.ClickHouse, buf)
	if err != nil {
		return "", err
	}
	qstr := buf.String()
	return dbr.InterpolateForDialect(qstr, buf.Value(), dialect.ClickHouse)
}``` 

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