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

QuoteTo function has bugs #107

Open
taomin597715379 opened this issue May 9, 2023 · 0 comments
Open

QuoteTo function has bugs #107

taomin597715379 opened this issue May 9, 2023 · 0 comments
Assignees

Comments

@taomin597715379
Copy link

GORM Playground Link

go-gorm/playground#1

Description

There is an issue with the QuoteTo method for the tuple data type of clickhouse, which resulted in the data not being written. An attempt was made to fix the issue, and the code is as follows:

func (dialector Dialector)  QuoteTo(writer clause.Writer, str string) {
	writer.WriteByte('`')
	if strings.Contains(str, ".") {
		for idx, str := range strings.Split(str, ".") {
			if idx > 0 {
				writer.WriteString(".")
			}
			writer.WriteString(str)
		}
		writer.WriteByte('`')
	} else {
		writer.WriteString(str)
		writer.WriteByte('`')
	}

}

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