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
Merged

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

@javiertury javiertury force-pushed the javiertury:master branch from ec2e5a0 to efa9d94 Oct 25, 2018
@codecov
Copy link

@codecov 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 force-pushed the javiertury:master branch 2 times, most recently from a11975c to 2e707b9 Oct 25, 2018
@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 javiertury:master branch 18 times, most recently from 652da77 to 19b04d4 Oct 26, 2018
@javiertury
Copy link
Contributor Author

@javiertury javiertury commented Oct 26, 2018

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

Looks good, some code style related changes

lib/dialects/postgres/connection-manager.js Outdated 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'];

This comment has been minimized.

@sushantdhiman

sushantdhiman Oct 27, 2018
Contributor

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

This comment has been minimized.

@javiertury

javiertury Oct 27, 2018
Author Contributor

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.

@javiertury javiertury force-pushed the javiertury:master branch from bbf977c to b9f94a4 Oct 27, 2018
@sushantdhiman sushantdhiman merged commit 3af0537 into sequelize:master Nov 1, 2018
4 checks passed
4 checks passed
codecov/patch 100% of diff hit (target 96.3%)
Details
codecov/project 96.3% (+<.01%) compared to 4b39e53
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Nov 1, 2018

Thanks @javiertury 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants