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

feat: Add Offset Implementation & Handling #300

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
add possible failing pg-typed test
  • Loading branch information
tripflex committed Jul 18, 2023
commit 4074179d14f057525e12a6f10c478868f8e56eb5
11 changes: 11 additions & 0 deletions packages/pg-typed/src/__tests__/index.test.pg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ test('create users', async () => {
]
`);

const photoRecordsOffset = await photos(db)
.find({owner_user_id: forbes.id})
.orderByAsc('cdn_url')
.offset(1)
.limit(1);
expect(photoRecordsOffset.map((p) => p.cdn_url)).toMatchInlineSnapshot(`
Array [
"http://example.com/3",
]
`);

const photoRecordsDesc = await photos(db)
.find({owner_user_id: forbes.id})
.orderByDesc('cdn_url')
Expand Down