-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(data-types): CIDR, INET, MACADDR support for Postgres #9567
Conversation
d205b95
to
006d3a4
Compare
@@ -32,7 +32,7 @@ | |||
"semver": "^5.5.0", | |||
"toposort-class": "^1.0.1", | |||
"uuid": "^3.2.1", | |||
"validator": "^10.0.0", | |||
"validator": "^10.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for isIPRange
.
Tests are now passing (the appveyor failure looks to be an existing flaky test). Let me know if more tests make sense. I'll also try to add some relevant docs to |
lib/dialects/postgres/data-types.js
Outdated
} | ||
inherits(CIDR, BaseTypes.CIDR); | ||
|
||
CIDR.parse = function parse(value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add parse if we are not modifying this value, I think just defining oids should be enough for all three of these types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sushantdhiman Done.
lib/dialects/postgres/data-types.js
Outdated
@@ -647,6 +647,39 @@ module.exports = BaseTypes => { | |||
array_oids: [] | |||
}; | |||
|
|||
function CIDR() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even these function definitions are not required, as there is no special handling required for Postgres initializing of these datatypes.
Just define OIDs for these types at the top with others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@sushantdhiman Thanks for shepherding this. Any chance it could get merged into v4? |
@gabegorelick Please open a new PR targeting v4 |
Thanks @sushantdhiman. I opened #9571 for that. |
Pull Request check-list
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
Adds support for Postgres network address types.
This is a continuation of work started by @tadman in #8154.
Closes #8154