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(postgres): dyanmic oids(#9863) #10077

Merged
merged 1 commit into from Nov 1, 2018

Conversation

javiertury
Copy link
Contributor

@javiertury javiertury commented Oct 25, 2018

Pull Request check-list

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Related to issue #9863. This pull request makes postgres DataTypes OID agnostic, all OID information is contained in ConnectionManager. They are refreshed automatically.

I've added some tests but I didn't run them. I will wait for this pull request to run them on travis.

EDIT: Autodetection of Ranges dropped, reasons in #9863

@codecov
Copy link

codecov bot commented Oct 25, 2018

Codecov Report

Merging #10077 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10077      +/-   ##
==========================================
+ Coverage    96.3%    96.3%   +<.01%     
==========================================
  Files          63       63              
  Lines        9413     9429      +16     
==========================================
+ Hits         9065     9081      +16     
  Misses        348      348
Impacted Files Coverage Δ
lib/data-types.js 95.15% <ø> (-0.07%) ⬇️
lib/dialects/postgres/data-types.js 97.87% <100%> (+0.04%) ⬆️
lib/dialects/postgres/connection-manager.js 94.4% <100%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b39e53...b9f94a4. Read the comment docs.

@javiertury javiertury changed the title feat(postgres): dyanmic oids and autodetect ranges(#9863) feat(postgres): dyanmic oids(#9863) Oct 26, 2018
@javiertury javiertury force-pushed the master branch 18 times, most recently from 652da77 to 19b04d4 Compare October 26, 2018 15:56
@javiertury
Copy link
Contributor Author

Take a look at travis tests, I pass all except for one test on postgres 10. The specific test I fail looks fishy. I belive it is not related to the work I have done. That specific test is run with this.retries(3), which could mean it is not a deterministic test.

Copy link
Contributor

@sushantdhiman sushantdhiman 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, some code style related changes

lib/dialects/postgres/connection-manager.js Show resolved Hide resolved
lib/dialects/postgres/connection-manager.js Outdated Show resolved Hide resolved
lib/dialects/postgres/connection-manager.js Show resolved Hide resolved
lib/dialects/postgres/connection-manager.js Outdated Show resolved Hide resolved
oids: [1083],
array_oids: [1183]
};
BaseTypes.UUID.types.postgres = ['uuid'];
Copy link
Contributor

Choose a reason for hiding this comment

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

This mapping doesn't serves any purpose, right? but leave it for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, as of now it doesn't have any purpose. Originally I had two cases in mind. The first one was to allow overriding the default type parser(this.lib.types.typeParser) within sequelize. In this case you need the mapping to get the OID and set the parser. The second case was range autodetection, which requires base types to be mapped.

@sushantdhiman sushantdhiman merged commit 3af0537 into sequelize:master Nov 1, 2018
@sushantdhiman
Copy link
Contributor

Thanks @javiertury 👍

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.

None yet

2 participants