Skip to content

IBM i (Db2 for i) Dialect - #13590

Closed
markirish wants to merge 31 commits into
sequelize:mainfrom
markirish:master
Closed

markirish wants to merge 31 commits into
sequelize:mainfrom
markirish:master

Conversation

@markirish

Copy link
Copy Markdown
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • 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 update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Hi there! My name is Mark Irish, and I'm an IBMer who works on open-source software on one of business systems, IBM i.

This PR implements an ibmi dialect, which connects to and generates queries for Db2 for i (the internal database at the heart of IBM i). This dialect has been a long time coming, and is spun-off of/part of this issue: #6263

For the last few years, I have published this dialect (and the rest of sequelize) as a standalone package called sequelize-ibmi. I am willing to keep this package as a separate effort, but I thought it would be nice to include the dialect in the base package and support it from there.

I have tried very hard to touch any files outside of lib/dialects/ibmi/ and tests/ as little as possible. Nonetheless, there are some dialect-specific code paths in the main sequelize code base, and I have included ibmi checks where appropriate.

As of the current commit when this PR was created, there are only 9 integration tests that fail (out of 1500+). They deal with all sorts of various edge cases, things like complex multiple OUTER JOIN statements, or the tests assuming that the connection is an EventEmitter. Nonetheless, I am confident that 98%+ of functionality works smoothly with the included dialect.

Currently I don't have a good CI/CD public IBM i system set up to run builds against: IBM is reluctant to provide a public box, but there are community systems that may prove useful once I have cleared the use with the owners. Tests will then connect remotely to that system to run unit and integration tests.

Anyways, I know that adopting an entire new dialect is a big undertaking, but I thought I would create the PR here (and keep it updated) to facilitate discussion and to show package parity with sequelize-ibmi.

Let me know what you think!

Mark Irish and others added 29 commits May 7, 2019 09:16
fixing issues with connector and tests
@github-actions github-actions Bot added the stale label Nov 2, 2021
@sdepold

sdepold commented Nov 2, 2021

Copy link
Copy Markdown
Member

Hey Mark,

I'll get back to you throughout the week :)

@sdepold sdepold removed the stale label Nov 2, 2021
@sdepold sdepold self-assigned this Nov 2, 2021
@sdepold

sdepold commented Nov 4, 2021

Copy link
Copy Markdown
Member

I had a super rough look through the changes and in general I'd be happy to merge this. However, we would need a well working CI pipeline for this first. Could there be any docker image to be used for that purpose? Please ping me on slack if you think that would be quicker @markdirish

@sdepold sdepold added the dialect: new For issues and PRs that relate to new dialect support label Nov 4, 2021
@markirish

Copy link
Copy Markdown
Contributor Author

Awesome!

Unfortunately there is no Docker container for IBM i. We do have a CI system for Node.js that we can use for the Node.js ecosystem as well. I will set up an account that the project can use to run tests. I will also spend a day or two polishing everything up (making sure the lint checks pass, seeing if I can fix those 9 tests or at least skip them, etc). and then ping here or on Slack.

@sdepold

sdepold commented Nov 22, 2021

Copy link
Copy Markdown
Member

We are going to have our monthly sequelize sync tomorrow and will discuss the matter of how to deal with dialect support requests there: https://www.meetup.com/eBay-Europe-Technology/events/282125063/

Feel free to drop by and participate in the discussion.

@markirish

Copy link
Copy Markdown
Contributor Author

Thanks @sdepold, would love to stop by.

I am still working on getting a CI system working for the dialect. I think I will also need a docker container (or a GitHub Actions workflow) setup to create a Linux system that has unixodbc installed, Node.js installed, the odbc npm package, and the IBM i ODBC driver.

@github-actions github-actions Bot removed the stale label Nov 23, 2021
@github-actions github-actions Bot added the stale label Dec 7, 2021
@sdepold

sdepold commented Dec 12, 2021

Copy link
Copy Markdown
Member

How is it going with this PR?

@github-actions github-actions Bot removed the stale label Dec 13, 2021
@markirish

Copy link
Copy Markdown
Contributor Author

I will look through the tests again tomorrow, but if I remember correctly, I think around 7 of the failures can be ignored, and then there were only 1 or 2 that actually needed attention.

The CI/CD system is going to be a thorn, I'm not sure the best way to approach it. The public IBM i system I was hoping to use is so slow as to be useless: It was taking over 8 hours to run the entire suite of integration tests, with some individual tests taking 5-10 minutes. For now, I can run new merges/PRs against the private development systems I have access to, but we will definitely need a better long term solution. I will continue to investigate.

I have begun to look at TypeScript-ifying the dialect, but only at a very cursory level. It is impossible to implement an interface or extend an abstract class if I don't have those units in hand. I know someone said they were going to take a look at typing the abstract query generator, but I am going to start in earnest on the rest of the AbstractDialect class.

@github-actions github-actions Bot added the stale label Dec 28, 2021
@WikiRik

WikiRik commented Jan 10, 2022

Copy link
Copy Markdown
Member

For the integration smoke test we discussed during today's meeting you might want to look at the one that was made for Snowflake; https://github.com/sequelize/sequelize/blob/main/test/integration/dialects/snowflake/smoke.test.js

@sdepold

sdepold commented Jan 10, 2022

Copy link
Copy Markdown
Member

Is this actually executed?

@WikiRik

WikiRik commented Jan 10, 2022

Copy link
Copy Markdown
Member

Is this actually executed?

The Snowflake smoke test? I think the Snowflake team runs it manually, but we don't do it as part of CI. But we can do that for this

@github-actions github-actions Bot removed the stale label Jan 11, 2022
@github-actions github-actions Bot added the stale label Jan 25, 2022
@markirish

Copy link
Copy Markdown
Contributor Author

Closing and opening a new PR. Merging from a different branch, with a slightly different history.

@markirish markirish closed this Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dialect: new For issues and PRs that relate to new dialect support stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants