add query appendf

This commit is contained in:
Aneurin Barker Snook
2023-10-08 22:50:24 +01:00
parent a3decd74c2
commit 25b14743be
2 changed files with 23 additions and 0 deletions
+10
View File
@@ -77,6 +77,16 @@ RETURN doc`,
"title": "Spaghetti",
},
},
// Append and Appendf
{
Input: NewQuery().
Appendf("FOR doc IN %s FILTER doc.title == @title RETURN doc", "recipes").
Bind("title", "Spaghetti"),
ExpectedStr: `FOR doc IN recipes FILTER doc.title == @title RETURN doc`,
ExpectedParams: map[string]any{
"title": "Spaghetti",
},
},
}
for n, tc := range testCases {