Fix query syntax for many relation through a pivot table.

This commit is contained in:
Madeorsk 2024-11-26 10:28:17 +01:00
parent 5382371954
commit cbca46020e
Signed by: Madeorsk
GPG key ID: 677E51CA765BB79F

View file

@ -117,8 +117,8 @@ pub fn typedMany(
});
query.join(.{
.sql = "INNER JOIN \"" ++ through.table ++ "\" ON AS \"" ++ prefix ++ "pivot" ++ "\" " ++
"\"" ++ toRepositoryConfig.table ++ "\"." ++ modelKey ++ " = " ++ "\"" ++ prefix ++ "pivot" ++ "\"." ++ through.joinModelKey,
.sql = "INNER JOIN \"" ++ through.table ++ "\" AS \"" ++ prefix ++ "pivot" ++ "\" " ++
"ON \"" ++ toRepositoryConfig.table ++ "\"." ++ modelKey ++ " = " ++ "\"" ++ prefix ++ "pivot" ++ "\"." ++ through.joinModelKey,
.params = &[0]_sql.RawQueryParameter{},
});