2 ms·
You are thinking of string interpolation. The idea behind string templates, the feature the example is showcasing, is effectively a way to define a function tha
by __ryan__ 4y ago
You are thinking of string interpolation. The idea behind string templates, the feature the example is showcasing, is effectively a way to define a function that can be called with similar syntax to string interpolation.
So DB."SELECT * FROM Person p WHERE p.last_name = \{name}" would basically be a function call like DB("SELECT * FROM Person p WHERE p.last_name = ", name), which would do the right thing to parameterize the SQL.