[Info-vax] Any stronger versions of the LMF planned ?, was: Re: LMF Licence Generator Code
Lawrence D’Oliveiro
lawrencedo99 at gmail.com
Thu Aug 12 22:04:50 EDT 2021
On Friday, August 13, 2021 at 1:18:36 PM UTC+12, Arne Vajhøj wrote:
>
> On 8/12/2021 7:52 PM, Lawrence D’Oliveiro wrote:
>>
>> filter_clause = " and ".join \
>> (
>> "%s = %s" % (field_name, format_sql_value(params[field_name]))
>> for field_name in field_names
>> if params[field_name] != ""
>> )
>
> There are two well known solutions.
>
> Single static SQL using the coalesce trick and sending over
> NULL for not used parameters.
>
> Building dynamic SQL with placeholders and just sending
> over the parameters used.
I like the way you don’t offer any actual code, just some vague hand-waving arguments. Go on, then: let’s see how you address an actual business need by actually thinking about the problem, rather than just mindlessly regurgitating something you read on Stack Overflow.
Then we can compare the quality of your solution versus mine.
More information about the Info-vax
mailing list