Pass function parameters into string formatting.

This commit is contained in:
Eli Ribble 2025-12-02 23:02:41 +00:00
parent b488730177
commit 41291f07b3
No known key found for this signature in database

View file

@ -67,7 +67,8 @@ func TestPreparedQuery(ctx context.Context) error {
type Skn struct {
Result int
}
query := psql.RawQuery("EXECUTE test_function(4)")
q := fmt.Sprintf("EXECUTE test_function(%d)", 4)
query := psql.RawQuery(q)
result, err := bob.One[Skn](ctx, PGInstance.BobDB, query, scan.StructMapper[Skn]())
if err != nil {
return fmt.Errorf("Failed to exectue test function: %w", err)