We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SetMap
Hi and thanks for your great jobs. It's nice to have such a tool to write sql queries nicely, you do a great job for maintenability.
I'm in a situation where I need to have both parameterized and raw values in an insert statement. The point is to generate a request like
INSERT INTO my_table COLUMNS (col_a, col_b, col_c) VALUES ($1, 42, $2)
I didn't find anything to do so in the lib, but I've found this piece of code that inspired me to find a solution to my problem
// insert.go 127 for v, val := range row { if vs, ok := val.(Sqlizer); ok { vsql, vargs, err := vs.ToSql() if err != nil { return nil, err } valueStrings[v] = vsql args = append(args, vargs...) } else { valueStrings[v] = "?" args = append(args, val) } }
So for now I'm just having a type RawSQL such as
RawSQL
type Raw string func (r Raw) ToSql() (string, []interface{}, error) { return string(r), nil, nil }
This works, and I was wondering if I'm missing anything from the lib or if it could be an interesting idea to implement it directly on the lib
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi and thanks for your great jobs. It's nice to have such a tool to write sql queries nicely, you do a great job for maintenability.
I'm in a situation where I need to have both parameterized and raw values in an insert statement. The point is to generate a request like
I didn't find anything to do so in the lib, but I've found this piece of code that inspired me to find a solution to my problem
So for now I'm just having a type
RawSQL
such asThis works, and I was wondering if I'm missing anything from the lib or if it could be an interesting idea to implement it directly on the lib
The text was updated successfully, but these errors were encountered: