First of all, props for the awesome work you're doing with the library!
I have a question related to how the all type can be used in Whereables.
The scenario is that I build the whereable object conditionally and one condition allows it to have no where statement and retrieve the complete dataset. I'm aware that I can use {} instead of all in these situations, but I like using all given it's more expressive.
When the generated type looks something like this, with id as a number,
id?: number | db.Parameter<number> | db.SQLFragment | db.ParentColumn | db.SQLFragment<any, number | db.Parameter<number> | db.SQLFragment | db.ParentColumn>;
The following code works without errors:
let tableWhereable: table_name.Whereable = all;
But, when the id becomes a string, it starts complaining with the following error
Type 'unique symbol' has no properties in common with type 'Whereable'.
I'm struggling to understand the difference of behaviour just because the id column's type is changed from number to string. I'm not sure if this is a bug or I'm missing something, so any help would be really appreciated.
Hello,
First of all, props for the awesome work you're doing with the library!
I have a question related to how the
all
type can be used in Whereables.The scenario is that I build the whereable object conditionally and one condition allows it to have no where statement and retrieve the complete dataset. I'm aware that I can use
{}
instead ofall
in these situations, but I like usingall
given it's more expressive.When the generated type looks something like this, with
id
as anumber
,The following code works without errors:
But, when the id becomes a
string
, it starts complaining with the following errorType 'unique symbol' has no properties in common with type 'Whereable'.
I'm struggling to understand the difference of behaviour just because the
id
column's type is changed fromnumber
tostring
. I'm not sure if this is a bug or I'm missing something, so any help would be really appreciated.Thank you!