Db2-Plugin #1131
Conversation
GergesBernaba1
commented
May 27, 2025
- Added getStructureFixed.js to provide an enhanced implementation of the getStructure method for the DB2 driver, including error handling and a fallback to a basic implementation.
- Updated sql.js to exclude system schemas from schema retrieval.
- Enhanced driver.js with improved column properties and schema handling configurations.
- Modified test-db2-driver.js to use environment variables for database connection details.
- Introduced test-network-debug.js for debugging network requests and testing API endpoints directly.
- Implemented DB2 database connection and query execution. - Added README.md for plugin installation and features. - Created icon.svg for DB2 representation. - Configured package.json with dependencies and scripts. - Developed backend driver for DB2 with methods for connection, querying, and transaction management. - Established frontend driver with connection fields and support for various database objects. - Implemented SQL helper functions for table creation, dropping, and selection. - Configured Webpack for both backend and frontend builds. - Added Prettier configuration for code formatting.
…g, and implement schema/table/column fetching
- Added TypeScript as a development dependency in package.json. - Created comprehensive documentation for DB2 plugin fixes, including API endpoints and testing instructions. - Improved error handling and connection stability in the DB2 driver. - Implemented multiple query approaches to address SQL syntax issues across different DB2 versions. - Added test scripts for verifying API endpoint functionality and connection handling.
…nism - Added getStructureFixed.js to provide an enhanced implementation of the getStructure method for the DB2 driver, including error handling and a fallback to a basic implementation. - Updated sql.js to exclude system schemas from schema retrieval. - Enhanced driver.js with improved column properties and schema handling configurations. - Modified test-db2-driver.js to use environment variables for database connection details. - Introduced test-network-debug.js for debugging network requests and testing API endpoints directly.
…t table counts - Added a new module `fixSchemaListIssue.js` to address the hanging issue in the `/database-connections/schema-list` endpoint and to refresh table counts correctly. - Enhanced the DB2 driver in `index.js` to apply the new fixes during initialization. - Created `schemaHelper.js` for helper functions related to schema operations, including refreshing schema counts. - Introduced `schemaRefresh.js` to provide an improved implementation for refreshing schema counts. - Updated the frontend driver configuration to include a global timeout for operations. - Developed comprehensive test scripts (`test-all-db2-fixes.js`, `test-schema-fixes.js`, `test-sql-endpoint-fix.js`) to validate the fixes and ensure proper functionality. - Added a verification script (`verify-fixes.js`) to check for required files and run tests with a mock DB2 connection.
|
Could you please share your database URL, of course without sensitive data? We have no experience with DB2 (I and nobody of my colleagues), so we are struggling with this a bit Ideally, also a screenshot of connection settings with erased sensitive data Thank yout |
…d with column fetching
…ba1/dbgate into them-desgin-refactor
|
Great thanks, I am connected now! Sometimes it shows correct structure, sometimes not... Probably problem is in method incrementalAnalysis in Analyser ? If this method will be deleted, it will behave better We have to do more test, but basically it seems to work As your plugin has GPL license, I have to ask you, whether it is OK for you to be shipped with commercial DbGate Premium? We have lot of tests for each DB engine (approx. 100), I could merge DB2 plugin into DbGate, but with - "Experimental" status, until all these tests will be implmeneted - passed or marked as skip Thank you |
|
Thanks for the update! I'll investigate the incremental incrementalAnalysis of the issue and the bug where eight procedures lack names under "All schemas." I'm happy to help with testing to stabilize the plugin. I'm fine with the GPL-licensed plugin being included in both DbGate Community and Premium editions. Please let me know if any licensing details need discussion. Labeling the plugin "experimental" until tests are complete makes sense. I can assist with test implementation or debugging. Let me know the next steps! |
|
Hi Jan, I've addressed the issue in a new pull request (#1135). |
|
Hi @janproch |
|
Hi @GergesBernaba1 , yes I did, thank you Thank you |
|
I’d be glad to contribute more to this project. Do you have a task list I can help with? Feel free to assign me any items. |
|
Thanks for the offer. There is lot of unsolved issue for DbGate - https://github.com/dbgate/dbgate/issues If you choose something, better to let me know, some issues are already in progress Thanks BTW. I have merged your newer DB2 PR into new feature branch - feature/db2, I will run some tests in this branch and then merge it into master - PR https://github.com/dbgate/dbgate/issues |
|
No good news, we have three times red https://github.com/dbgate/dbgate/actions/runs/15536757630 ... |
|
@janproch, Are you trying to update the Electron version to: 32.1.0! |
|
Could run the action again! |
|
I tried change version - 32.1.0, the same error - https://github.com/dbgate/dbgate/actions/runs/15577442183/job/43864975613 Build process is building native img_db package, but it should use precompiled version, probably precompiled version is not found Probably right electron version with precompiled packages should solve this. But unfortunately, I have no capacity to solve this before current release, so probably we have to postpone adding DB2 to next release |
|
Hi @janproch |
|
On my PC it also worked correctly in local development. But we need to correctly build it on github pipelines, this is a bit more complicated, because imb_db package uses native JS module, which brings problems always. This job could not be easily delegated any of my colleagues, so it must wait, until there are no urgencies from Premium users and from DbGate investor |
|
Hi @GergesBernaba1 , thanks for patience There is apparantly problem with installing this package in electron, docker build works correctly - https://github.com/dbgate/dbgate/actions/runs/16340367906 , but electron build fails when installing packages - https://github.com/dbgate/dbgate/actions/runs/16340367905 I replicated this problem on my local computer with Windows OS, using commands: According to documentation, there should be precompiled packages, for electron, but they are not used
|
|
@GergesBernaba1 It worked locally for you even under electron ? Did you install packages for electron? ( yarn install in "app" subdirectory) |
|
yes i did |
|
If it works for you, could you please send me console log, when adding ibm_db package to electron app? cd app
yarn add ibm_dbI ended with following error, I would like to know, whether your install process used precompiled package for electron: |
|
yarn add ibm_db |
|
i have to set this before run it: and add those if not in the package JSON file: And in the main, in the same file: |
|
@janproch are you checking it? |
|
I am trying to upgrade to newest stable electron 37 now, I hope it will help solve issues like this |
|
@janproch Are you still waiting for any modifications from me? |
|
@GergesBernaba1 plugin is OK, the problem is with the DB2 native NPM package, which breaks electron app installation. I have no idea how to solve this, probably big upgrade of all dependencies could help, but for this big upgrade we have curreclty no free capacity |
|
Problem is the build process But the number of probles regarding old electron is growing (eg. #1243 ), maybe we have to make finally un upgrade, which probably will solve problem with DB2 plugin build |
|
Electron was succesfully upgraded, but ibm_db driver doesn't seem to install. I also upgraded to newest version ibm_db, without success. Installing this package fails on build server: https://github.com/dbgate/dbgate/actions/runs/19261459987/job/55067011732 |
|
@GergesBernaba1 thanks for the update I added GH action But there is the same problem when running yarn install https://github.com/dbgate/dbgate/actions/runs/20719819077/job/59480310086 |
|
@janproch could you run it again? |