Skip to content

feat(server-core)!: Remove deprecated dbType option#11045

Open
ovr wants to merge 2 commits into
feat/release-v1.7.0from
feat/remove-db-type
Open

feat(server-core)!: Remove deprecated dbType option#11045
ovr wants to merge 2 commits into
feat/release-v1.7.0from
feat/remove-db-type

Conversation

@ovr

@ovr ovr commented Jun 9, 2026

Copy link
Copy Markdown
Member

CreateOptions.dbType has been deprecated since v0.30.30 and is now removed. Passing it throws an error. Use driverFactory instead (return a DriverConfig { type, ... }), or set the CUBEJS_DB_TYPE environment variable.

BREAKING CHANGE: CreateOptions.dbType has been removed. Use driverFactory instead.

`CreateOptions.dbType` has been deprecated since v0.30.30 and is now
removed. Passing it throws an error. Use driverFactory instead (return
a DriverConfig `{ type, ... }`), or set the `CUBEJS_DB_TYPE` environment
variable.

BREAKING CHANGE: CreateOptions.dbType has been removed. Use driverFactory instead.
@ovr ovr requested review from a team and keydunov as code owners June 9, 2026 17:23
@github-actions github-actions Bot added the javascript Pull requests that update Javascript code label Jun 9, 2026
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ovr's task in 1m 27s —— View job


Code Review — feat(server-core)!: Remove deprecated dbType option

Overall this is a clean, well-scoped breaking change. Removal is consistent across OptsHandler, public types, Joi validation, DEPRECATION.md, docs, tests, and birdbox fixtures. Behavior at runtime collapses cleanly to the two supported paths (driverFactory returning a DriverConfig, or CUBEJS_DB_TYPE + BaseDriver factory). ✅

Verdict: approve direction — 0 high, 0 medium, 4 low/nit.

Details — findings + completed checklist

Checklist

  • Gather context (diff, related references in server.ts / CompilerApi.ts)
  • Review OptsHandler / types.ts / optionsValidate.ts / DevServer.ts
  • Review test changes
  • Review birdbox fixtures and getCore.ts
  • Check for stale review threads (none)
  • Post review

Findings

1. DbTypeFn is now dead public API (low)
packages/cubejs-server-core/src/core/types.ts keeps DbTypeFn exported with an @deprecated JSDoc, but CreateOptions.dbType is gone, assertDbTypeResult is gone, and the type is no longer referenced anywhere in the production sources. Since this PR is a breaking-change major bump, it's worth deciding whether to remove DbTypeFn outright too — leaving it exported invites users to think the slot is still configurable. If you want to soften the migration for downstream TS consumers, fine; otherwise drop it.

2. Error message wording (nit)
packages/cubejs-server-core/src/core/OptsHandler.ts:83-87 says “has been deprecated and removed”. Since this is the removal, “has been removed in v1.7.0” is tighter and matches the DEPRECATION.md phrasing. Consider also including a link to DEPRECATION.md#dbtype for users hitting this at runtime.

3. getDbType signature is over-broad (nit)
OptsHandler.ts:200-204 still takes opts: CreateOptions & { driverFactory: DriverFactoryInternalFn } but the body now only destructures driverFactory. It could just take driverFactory: DriverFactoryInternalFn directly — clearer and avoids cloning a whole options object as a call-site convention.

4. DevServer.dbType payload is now always null (low)
packages/cubejs-server-core/src/core/DevServer.ts:122 always sends dbType: null to the dev playground. The dev UI used to read this to render context/wizard hints. Worth a quick check that the playground gracefully degrades when this is always null (probably fine since it was already null when users didn't pass dbType, but the surface is no longer reachable at all now).

Notes / non-issues

  • (opts as any).dbType cast in assertOptions is appropriate — it's specifically catching users still passing the now-removed field via JS, which TS can no longer flag.
  • The lambda fixture migration is a minor behavior tightening: previously a non-default, non-ksql dataSource would set dbType to the dataSource string while still constructing a PostgresDriver (inconsistent). After this PR, both type and driver are postgres. This is a small improvement and unlikely to affect real users, but worth noting in the changelog if anyone relied on the quirk.
  • server.ts:725 (options.dbType || this.options.dbType) and server.ts:198 (this.contextToDbType = this.options.dbType) continue to work because OptsHandler populates options.dbType internally with the resolved DbTypeInternalFn — confirmed.
  • Tests faithfully cover the new throw path and prune the deprecated-warning paths.
· branch [`feat/remove-db-type`](https://github.com/cube-js/cube/tree/feat/remove-db-type)

@github-actions github-actions Bot added rust Pull requests that update Rust code python labels Jun 9, 2026
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ovr's task in 1m 5s —— View job


Code Review — re-run on sync

No new commits since the prior review at 17:23Z (HEAD is still b10ec89, base origin/feat/release-v1.7.0). The 4 prior nits still apply; nothing new to flag.

Prior findings — still applicable
  1. DbTypeFn is now dead public API (low)packages/cubejs-server-core/src/core/types.ts keeps DbTypeFn exported with @deprecated, but it's no longer referenced in production sources. Since this is a breaking-change major bump, consider removing it outright.
  2. Error message wording (nit)packages/cubejs-server-core/src/core/OptsHandler.ts:83-87 says "has been deprecated and removed"; tighter as "has been removed in v1.7.0". Consider linking DEPRECATION.md#dbtype.
  3. getDbType over-broad signature (nit)OptsHandler.ts:200-204 accepts opts: CreateOptions & { driverFactory } but only destructures driverFactory; could just take driverFactory directly.
  4. DevServer.dbType always null (low)DevServer.ts:122 now always sends dbType: null to the playground. Worth confirming the dev UI degrades gracefully.

Verdict: approve direction — 0 high, 0 medium, 4 low/nit (unchanged).

· branch feat/remove-db-type ·

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/release-v1.7.0@ebb6f2f). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             feat/release-v1.7.0   #11045   +/-   ##
======================================================
  Coverage                       ?   79.09%           
======================================================
  Files                          ?      470           
  Lines                          ?    95777           
  Branches                       ?     3502           
======================================================
  Hits                           ?    75757           
  Misses                         ?    19506           
  Partials                       ?      514           
Flag Coverage Δ
cube-backend 58.71% <100.00%> (?)
cubesql 83.54% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code python rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants