Skip to content

Commit

Permalink
imrpove grammar builder type (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lupennat authored Jan 15, 2024
1 parent df6231f commit 6ba28ae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ludb",
"version": "0.0.10",
"version": "0.0.11",
"description": "Nodejs Query Builder",
"author": "Claudio Pennati <claudio.pennati@gmail.com>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/query/common-grammar-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ abstract class CommonGrammarBuilder<
/**
* Create a new query instance for nested where condition.
*/
public forNestedWhere(): this {
public forNestedWhere(): any {
return this.newQuery().from(this.registry.from);
}

Expand Down
7 changes: 7 additions & 0 deletions src/query/join-clause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ class JoinClause<Parent extends GrammarBuilderI = GrammarBuilderI>
return new this.parentClass(this.parentConnection);
}

/**
* Create a new query instance for nested where condition.
*/
public forNestedWhere(): JoinClauseI {
return super.forNestedWhere();
}

/**
* Clone the query.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/query/query-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ class QueryBuilder extends BaseQueryBuilder implements QueryBuilderI {
return super.forSubQuery();
}

/**
* Create a new query instance for nested where condition.
*/
public forNestedWhere(): QueryBuilderI {
return super.forNestedWhere();
}

/**
* Get a new instance of the query builder.
*/
Expand Down

0 comments on commit 6ba28ae

Please sign in to comment.