-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Description
According to documentation, idColumn should be set to null in the event a table does not have an id column: https://vincit.github.io/objection.js/api/model/static-properties.html#static-idcolumn
But due to the typings, null is not a possible valid value for idColumn - only string | string[]:
objection.js/typings/objection/index.d.ts
Line 1541 in d1e194a
| static idColumn: string | string[]; |
This causes an issue in my code on version 3.1.4. Doing either:
static idColumn = null;
or
static get idColumn() {
return null;
}
Results in a compiler error:
Types of property 'idColumn' are incompatible.
Type 'null' is not assignable to type 'string | string[]```
Only by casting like `static idColumn = null as unknown as string;` can I work around the issue. Not setting idColumn causes runtime errors.
Metadata
Metadata
Assignees
Labels
No labels