Skip to content

Conversation

@nialexsan
Copy link

Description of change

Fixes #10456

Adds jsonpath column type for Postgres

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@pleerock
Copy link
Member

looks like tests are failing

},
]
document.date = new Date()
document.path = "$.weight"
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't need it here


@Column({ type: "jsonpath" })
path: string

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't need it here

post.uuid = "0e37df36-f698-11e6-8dd4-cb9ced3df976"
post.json = { id: 1, name: "Post" }
post.jsonb = { id: 1, name: "Post" }
post.jsonpath = "$.name"
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add a test checks below like we did for another column types

Copy link
Author

Choose a reason for hiding this comment

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

added assertions for jsonpath

@nialexsan nialexsan requested a review from AlexMesser February 13, 2024 23:42
@nialexsan
Copy link
Author

@pleerock the oracle test failed due to a timeout, could you please rerun it?
it seems to be a flaky one

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your help @nialexsan
is this PR still valid? can you fix the test and align the PR with the master branch please?

import { expect } from "chai"
import { Example } from "./entity/example"

// values from https://github.com/obartunov/sqljsondoc/blob/master/jsonpath.md#jsonpath-in-postgresql
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather add link to the postgres documentation here, and only mention source for the current values in the comment for PR.

Valid links would be:

beforeEach(() => reloadTestingDatabases(connections))
after(() => closeTestingConnections(connections))

it("should insert and retrieve jsonpath values as strings", () =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think all those tests should be implemented in test/functional/database-schema/column-types/postgres/column-types-postgres.ts. This is not a bug we are dealing with here, rather new feature. It would be super hard to find those tests later when the burried in issue-10456.ts

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

This PR is stale, I'm going to close it in favour of #11684

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.

Add support for jsonpath column type for postgres

5 participants