I have the beginning of a function that I want to use, but I need help simplifying the following scenarios (SQL related).
My goal = write the leanest function logic possible to accommodate the use cases described below.
I call the function and with an Instance. = 1,0
I call the function without an instance. = 0,0
I call the function with an instance, but without a DB. = 1,0
I call the function with an instance, and a DB. = 1,1
I call the function without an instance, but with a DB. = 0,1
I call the function with a DB. = 0,1
For some reason I am hung up on simplifying these use cases, despite the fact I wrote it out in a binary/true false type story.
I am stuck picturing a variable associated with some sort of a switch statement instead of nested if(s).