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

fix(data-store): take and skip for postgres #1249

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

simonas-notcat
Copy link
Contributor

What issue is this PR fixing

When running dataStoreORMGetVerifiableCredentials with :

{
    "order": [
        {
            "column": "issuanceDate",
            "direction": "DESC"
        }
    ],
    "take": 10,
    "skip": 0
}

on an agent that is using Postgres DB you would get this error:

for SELECT DISTINCT, ORDER BY expressions must appear in select list

What is being changed

Using qb.offset() and qb.limit() instead of qb.skip() and qb.take()

As suggested here: typeorm/typeorm#4742 (comment)

Quality

Check all that apply:

  • I want these changes to be integrated
  • I successfully ran pnpm i, pnpm build, pnpm test, pnpm test:browser locally.
  • I allow my PR to be updated by the reviewers (to speed up the review process).
  • I added unit tests.
  • I added integration tests.
  • I did not add automated tests because _________, and I am aware that a PR without tests will likely get rejected.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d178603) 84.92% compared to head (1599635) 84.92%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1249   +/-   ##
=======================================
  Coverage   84.92%   84.92%           
=======================================
  Files         167      167           
  Lines       18120    18120           
  Branches     2036     2036           
=======================================
  Hits        15388    15388           
  Misses       2732     2732           
Files Changed Coverage Δ
packages/data-store/src/data-store-orm.ts 90.39% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirceanis mirceanis changed the base branch from next to main September 20, 2023 07:10
@mirceanis mirceanis changed the base branch from main to next September 20, 2023 07:20
Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mirceanis mirceanis merged commit fcd2699 into next Sep 20, 2023
@mirceanis mirceanis deleted the fix/data-store-skip-take branch September 20, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants