From cbca46020e3ac573693499562ae39895b1b43d4d Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Tue, 26 Nov 2024 10:28:17 +0100 Subject: [PATCH] Fix query syntax for many relation through a pivot table. --- src/relations.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/relations.zig b/src/relations.zig index 7ac0891..18f5d7b 100644 --- a/src/relations.zig +++ b/src/relations.zig @@ -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{}, });