Skip to content

Conversation

@j2cry
Copy link

@j2cry j2cry commented Dec 3, 2025

This PR solves at least three opened issues (#728, #875, #1390).
It changes connection tree and provides functionality for browsing procedures, functions, indexes and triggers.
It also adds a control for obtaining DDL scripts for all of these objects, as well as for tables and views.

Third-party driver developers can add this functionality by implementing the appropriate basic methods.


  • Your code builds clean without any errors or warnings
  • You have made the needed changes to the docs
  • You have written a description of what is the purpose of this pull request above

@gjsjohnmurray
Copy link
Collaborator

Thanks for your PR. I have started looking at it.

It seems to have broken the existing "Generate Insert Query" feature. For example, on the COMPANY test table and using the MySQL driver this now generates the following:

INSERT INTO COMPANY (COLUMNS, INDEXES, Triggers)
VALUES (
    'Columns:undefined',
    'Indexes:undefined',
    'Triggers:undefined'
  );

Previously it generated this:

INSERT INTO COMPANY (ID, NAME, AGE, ADDRESS, SALARY)
VALUES (
    ID:int,
    'NAME:text',
    AGE:int,
    'ADDRESS:char',
    'SALARY:double'
  );

@j2cry
Copy link
Author

j2cry commented Jan 7, 2026

@gjsjohnmurray thanks for review. I have fixed it.

@j2cry j2cry force-pushed the j2cry-extend-obj-browsing branch from 2099fa7 to 12d376b Compare January 7, 2026 11:45
@gjsjohnmurray
Copy link
Collaborator

Thanks for fixing this.

My next observation is that when I expand the Indexes node of a MySQL table that has no indexes I get this error notification:

Request connection/GetChildrenForTreeItemRequest failed with message: Expression #1 of ORDER BY clause is not in SELECT list, references column 'information_schema.ix.INDEX_NAME' which is not in SELECT list; this is incompatible with DISTINCT

@j2cry
Copy link
Author

j2cry commented Jan 7, 2026

That's very strange. I just tested this for MySQL 5.7, 8.0 and 9.5, but no such notification appeared. Can you describe this case in more detail?

@gjsjohnmurray
Copy link
Collaborator

I'm testing with the test-vscode-sqltools.code-workspace that's in the test folder of the codebase. Some doc about using it is at https://vscode-sqltools.mteixeira.dev/en/contributing/testing

After opening the workspace I use the Compose Up context menu action of mysql/docker-compose.yml in Explorer view (that file is in test/docker/mysql of the project repo) to launch the container that the MySQL connection of the workspace's sqltools.connections object defines.

From the SQLTools view I activate that connection.

Then I use the script starting at line 5 of test/docker/mysql/1.create-some-stuff.sql to create two tables:

DROP TABLE IF EXISTS DEPARTMENT;
DROP TABLE IF EXISTS COMPANY;

CREATE TABLE COMPANY(
    ID INT PRIMARY KEY NOT NULL,
    NAME TEXT NOT NULL,
    AGE INT NOT NULL,
    ADDRESS CHAR(50),
    SALARY REAL
);

CREATE TABLE DEPARTMENT(
    ID INT PRIMARY KEY NOT NULL,
    DEPT CHAR(50) NOT NULL,
    EMP_ID INT NOT NULL,
    COMPANY_ID INT NOT NULL,
    FOREIGN KEY (COMPANY_ID) REFERENCES COMPANY(ID)
);

When I expand the Indexes subfolder of either table I get the error.

Running SELECT VERSION(); outputs the string 8.0.31

For compatibility with ONLY_FULL_GROUP_BY sql mode
@j2cry
Copy link
Author

j2cry commented Jan 7, 2026

It seems to be a feature of the default settings for MySQL versions 8.0.30 to 8.0.33. Since 8.0.34 everything is ok.
After reconfiguration, it's ok too.

I made a simple fix.

@gjsjohnmurray
Copy link
Collaborator

Thanks for fixing this.

Please bump the maintenance part of the version number of the 4 drivers you have changed, and also append a -SNAPSHOT suffix. For example in driver.mysql/package.json change "version": "0.6.6" to `"version": "0.6.7-SNAPSHOT".

Please also update docs/src/pages/en/contributing/support-new-drivers.mdx with information to help driver authors leverage the new capabilities.

@gjsjohnmurray
Copy link
Collaborator

Please bump the maintenance part of the version number of the 4 drivers

Just noticed that packages/drivers.sqlite/package.json is already at a -SNAPSHOT version so it's only the other 3 drivers you need to make the change in.

avagadro added 2 commits January 8, 2026 15:30
@sqltools/driver.mssql to 0.4.11-SNAPSHOT
@sqltools/driver.mysql to 0.6.7-SNAPSHOT
@sqltools/driver.pg to 0.5.8-SNAPSHOT
@j2cry
Copy link
Author

j2cry commented Jan 8, 2026

done

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.

2 participants