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

add FETCH clause support. #822

Merged
merged 17 commits into from
Feb 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into feat-offset-fetch
igalklebanov authored Jan 8, 2024
commit fbad7b84bf7202d0f403cae20e15964cbe09bacb
1 change: 1 addition & 0 deletions src/dialect/mssql/mssql-query-compiler.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { AddColumnNode } from '../../operation-node/add-column-node.js'
import { AlterTableColumnAlterationNode } from '../../operation-node/alter-table-node.js'
import { DropColumnNode } from '../../operation-node/drop-column-node.js'
import { OffsetNode } from '../../operation-node/offset-node.js'
import { MergeQueryNode } from '../../operation-node/merge-query-node.js'
import { DefaultQueryCompiler } from '../../query-compiler/default-query-compiler.js'

export class MssqlQueryCompiler extends DefaultQueryCompiler {
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -199,6 +199,8 @@ export * from './operation-node/json-path-leg-node.js'
export * from './operation-node/json-path-node.js'
export * from './operation-node/json-operator-chain-node.js'
export * from './operation-node/tuple-node.js'
export * from './operation-node/merge-query-node.js'
export * from './operation-node/matched-node.js'
export * from './operation-node/fetch-node.js'

export * from './util/column-type.js'
4 changes: 4 additions & 0 deletions src/query-builder/select-query-builder.ts
Original file line number Diff line number Diff line change
@@ -75,6 +75,10 @@ import { Streamable } from '../util/streamable.js'
import { ExpressionOrFactory } from '../parser/expression-parser.js'
import { ExpressionWrapper } from '../expression/expression-wrapper.js'
import { SelectQueryBuilderExpression } from './select-query-builder-expression.js'
import {
ValueExpression,
parseValueExpression,
} from '../parser/value-parser.js'
import { FetchModifier, FetchNode } from '../operation-node/fetch-node.js'

export interface SelectQueryBuilder<DB, TB extends keyof DB, O>

Unchanged files with check annotations Beta

create(rowCount: number | bigint): LimitNode {
return freeze({
kind: 'LimitNode',
limit: ValueNode.create(rowCount),

Check failure on line 20 in src/operation-node/limit-node.ts

GitHub Actions / run-tests (20.x, 1.x, 1.34.x)

Cannot find name 'ValueNode'.

Check failure on line 20 in src/operation-node/limit-node.ts

GitHub Actions / run-tests (18.x, 1.x, 1.34.x)

Cannot find name 'ValueNode'.
})
},
})
},
create(offset: number | bigint): OffsetNode {
return freeze({

Check failure on line 18 in src/operation-node/offset-node.ts

GitHub Actions / run-tests (20.x, 1.x, 1.34.x)

Type 'Readonly<{ kind: "OffsetNode"; offset: number | bigint; }>' is not assignable to type 'OffsetNode'.

Check failure on line 18 in src/operation-node/offset-node.ts

GitHub Actions / run-tests (18.x, 1.x, 1.34.x)

Type 'Readonly<{ kind: "OffsetNode"; offset: number | bigint; }>' is not assignable to type 'OffsetNode'.
kind: 'OffsetNode',
offset,
})
...this.#props,
queryNode: DeleteQueryNode.cloneWithLimit(
this.#props.queryNode,
LimitNode.create(parseValueExpression(limit))

Check failure on line 637 in src/query-builder/delete-query-builder.ts

GitHub Actions / run-tests (20.x, 1.x, 1.34.x)

Argument of type 'OperationNode' is not assignable to parameter of type 'number | bigint'.

Check failure on line 637 in src/query-builder/delete-query-builder.ts

GitHub Actions / run-tests (18.x, 1.x, 1.34.x)

Argument of type 'OperationNode' is not assignable to parameter of type 'number | bigint'.
),
})
}
You are viewing a condensed version of this merge commit. You can view the full changes here.