Comment by duncanfwalker
3 months ago
I guess it's more clear that it should be a to statically readable value? eg you shouldn't do things like use arguments to build the str
3 months ago
I guess it's more clear that it should be a to statically readable value? eg you shouldn't do things like use arguments to build the str
I would def use this if there was a return “select …” option. There are heaps of scenarios where sql is modified based on parameters. If no doc string just use the return value maybe?
Our queries are typically large, not 3-5 liners.
(Filter view queries where you might add additional CTA’s to provide the necessary filter conditions, but aren’t desirable if particular filter parameter is nill, etc.)
Hello, author here. It is actually possible to use return instead with a different set of decorators: check out the first "tip" block on this page: https://hyperflask.github.io/sqlorm/sql-functions/
Just keep in mind best practice is to use the built-in parameter interpolation that comes with your db library, since it handles escaping SQL injection for you.
Be very careful if you ever use bare string formatting to construct your queries.