Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using all type in Whereables gives error Type 'unique symbol' has no properties in common with type 'Whereable'. #171

Open
yasithA opened this issue May 4, 2024 · 0 comments

Comments

@yasithA
Copy link

yasithA commented May 4, 2024

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 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.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant