Skip to content

feat: add Dameng DM8 support - #585

Draft
wkyfasttank wants to merge 1 commit into
xo:mainfrom
wkyfasttank:feature_v0.21.4_wky_damengSupport
Draft

feat: add Dameng DM8 support#585
wkyfasttank wants to merge 1 commit into
xo:mainfrom
wkyfasttank:feature_v0.21.4_wky_damengSupport

Conversation

@wkyfasttank

Copy link
Copy Markdown

Summary

  • Add a pure Go Dameng DM8 driver backed by github.com/godoes/gorm-dameng/dm8.
  • Support dm, dm8, and dameng connection URLs with port 5236 defaults, schema path translation, IPv6 hosts, and native DM8 SSL parameters.
  • Reuse the Oracle metadata reader and add DM8-specific materialized-view classification and privilege summaries for the standard describe commands.
  • Keep MySQL and DM8 usage consistent through named connections, including names containing hyphens and single-line meta commands.

Design notes

  • DM8 uses the existing usql permission model and does not introduce a driver-specific read-only gate or confirmation flow.
  • Materialized-view detection follows the DBX strategy: use SYS.SYSOBJECTS first and fall back to ALL_DEPENDENCIES for restricted accounts.
  • The URL schemes are registered at runtime until github.com/xo/dburl provides native Dameng support.

Testing

  • go test -tags most ./drivers/dameng ./env ./handler ./internal -count=1
  • go vet -tags most ./drivers/dameng ./env ./handler ./internal
  • Verified identical SELECT 1 named-connection commands against nine MySQL databases and one DM8 database.
  • Verified the standard describe, materialized-view, and privilege meta commands against DM8.

Register dm, dm8, and dameng URLs with the pure Go DM8 driver.
Reuse Oracle metadata with DM materialized-view and privilege support.
Keep named connections and single-line meta commands consistent.
@kenshaw

kenshaw commented Aug 3, 2026

Copy link
Copy Markdown
Member

@wkyfasttank Hey, actually appreciate this LLM generated PR. Some requests:

  1. Please submit a PR to dburl adding the Scheme there, and then run the gen.go to regenerate the entries in README.md
  2. Please simplify/cleanup the comments and make them cut off / wrap at 100 characters -- I do everything from a terminal and it makes it hard to review when the lines don't wrap
  3. Please rebase/fix conflicts from the release-21 branch, so that it can be cherry-picked to the main branch. main is unfinished, and while I'd like to get it out, it's not high on my personal development list and I only build/maintain usql in my free time
  4. Incorporating tests are fine. Please do not use any third-party libraries. Use pure Go only when building tests, as it adds additional dependencies that just are not necessary -- for example, the go-sqlmock package was added, which will not be added to usql or to dburl
  5. Please do not add comments to code you did not write
  6. Please separate this into multiple PRs, a PR just for adding the database driver and its accompanying metadata driver, and a separate PR for adding the additional functionality. I will be more inclined to add it if core usql functionality is not touched.

Have your agent let me know your thoughts. The work is appreciated, thanks!

@wkyfasttank
wkyfasttank marked this pull request as draft August 4, 2026 01:59
@wkyfasttank

Copy link
Copy Markdown
Author

Thank you. I'm honored that you appreciate my work.

I'm a junior Java developer with less than two years of professional experience. While using usql at work, I found that it did not yet support the Dameng (DM) database very well. Since usql is lightweight and convenient, I wanted to extend its database support and share the improvement with others.

With the help of LLM tools, this is my first contribution to an open-source project. I may have overlooked some project conventions, so I sincerely appreciate any further guidance.

Thank you again for taking the time to review this PR and for your detailed feedback.

@kenshaw

kenshaw commented Aug 4, 2026

Copy link
Copy Markdown
Member

It's fine -- your PR seemed mostly OK. Please try to submit a testing configuration for Dameng DB by creating contrib/podman-config and contrib/usql-config, as I use the podman-run.sh to test usql with various databases. I'm not familiar with Dameng, so it would greatly accelerate my ability to review any PRs associated with this database. Thanks in advance.

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