Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@yasithA

Description

@yasithA

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions