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

Missing typings for QueryBuilder.tableRef #2364

Open
IlyaSemenov opened this issue Mar 16, 2023 · 2 comments
Open

Missing typings for QueryBuilder.tableRef #2364

IlyaSemenov opened this issue Mar 16, 2023 · 2 comments

Comments

@IlyaSemenov
Copy link
Contributor

QueryBuilder has a convenient method tableRef which returns the alias for the model the query builder operates against:

tableRef() {
return this.tableRefFor(this.modelClass().getTableName());
}

However it's not exposed in typings and not mentioned in the documentation. Can we add it?


On a side note, its implementation clearly contradicts the typings for tableRefFor:

interface TableRefForMethod {
(modelClass: typeof Model): string;
}

the method is supposed to accept a model class, but the actual implementation passes a string.

@lehni
Copy link
Collaborator

lehni commented Apr 14, 2023

Thanks for pointing this out. Would you be willing to submit a PR to fix this?

@IlyaSemenov
Copy link
Contributor Author

Sure.

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

No branches or pull requests

2 participants