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
When using subquery in JoinClause with dollar placeholders query builder produces wrong placeholder numbers.
JoinClause
This test reproduces the problem.
func TestSelectJoinClausePlaceholderNumbering(t *testing.T) { subquery := Select("a").Where(Eq{"b": 2}).PlaceholderFormat(Dollar) sql, args, err := Select("t1.a"). From("t1"). Where(Eq{"a": 1}). JoinClause(subquery.Prefix("JOIN (").Suffix(") t2 ON (t1.a = t2.a)")). PlaceholderFormat(Dollar). ToSql() assert.NoError(t, err) expectedSql := "SELECT t1.a FROM t1 JOIN ( SELECT a WHERE b = $1 ) t2 ON (t1.a = t2.a) WHERE a = $2" assert.Equal(t, expectedSql, sql) assert.Equal(t, []interface{}{2, 1}, args) }
The text was updated successfully, but these errors were encountered:
#316 JoinClause with subquery produces wrong dollar parameter placeho…
9b18b54
…lders (#317)
merge: [Masterminds#316](Masterminds#316) [Masterminds#331](Mastermin…
0c7762f
…ds#331)
merge: Masterminds#316 Masterminds#331
ca08673
No branches or pull requests
When using subquery in
JoinClause
with dollar placeholders query builder produces wrong placeholder numbers.This test reproduces the problem.
The text was updated successfully, but these errors were encountered: