Skip to content

Feat/sql api database meta#10935

Open
SaschaJohn wants to merge 9 commits into
cube-js:masterfrom
SaschaJohn:feat/sql-api-database-meta
Open

Feat/sql api database meta#10935
SaschaJohn wants to merge 9 commits into
cube-js:masterfrom
SaschaJohn:feat/sql-api-database-meta

Conversation

@SaschaJohn
Copy link
Copy Markdown

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • [-] Docs have been added / updated if required

Issue Reference this PR resolves

#10934

Description of Changes Made (if issue reference is not provided)

expose the existing dbname from session to metadata

SaschaJohn and others added 3 commits May 22, 2026 09:44
…equestMeta

The PostgreSQL wire protocol startup message includes a `database`
parameter, which is already parsed and stored on SessionState. However,
it was never included in LoadRequestMeta, making it inaccessible to
JS configuration callbacks like extendContext.

This is needed for multi-tenant setups where the database name carries
the tenant identifier (e.g. a UUID), allowing checkSqlAuth or
extendContext to resolve tenant context from the client-supplied dbname.

Changes:
- Add `database: Option<String>` field to LoadRequestMeta (Rust)
- Populate it from SessionState::database() in get_load_request_meta
- Add `database?: string` to BaseMeta TypeScript interface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@SaschaJohn SaschaJohn requested review from a team as code owners May 22, 2026 09:55
@github-actions github-actions Bot added rust Pull requests that update Rust code javascript Pull requests that update Javascript code pr:community Contribution from Cube.js community members. labels May 22, 2026
@SaschaJohn
Copy link
Copy Markdown
Author

@ovr @paveltiunov may I kindly ask for a review? Would be great. Thanks in advance

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.83%. Comparing base (1dae639) to head (c5a666a).
⚠️ Report is 32 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (1dae639) and HEAD (c5a666a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1dae639) HEAD (c5a666a)
cubesql 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10935       +/-   ##
===========================================
- Coverage   83.53%   58.83%   -24.71%     
===========================================
  Files         254      210       -44     
  Lines       75869    16603    -59266     
  Branches        0     3358     +3358     
===========================================
- Hits        63378     9768    -53610     
+ Misses      12491     6344     -6147     
- Partials        0      491      +491     
Flag Coverage Δ
cube-backend 58.83% <ø> (?)
cubesql ?

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

☔ View full report in Codecov by Sentry.
📢 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.

SaschaJohn and others added 3 commits June 2, 2026 12:32
Thread database name from PostgreSQL startup parameters through
SqlAuthServiceAuthenticateRequest into CheckSQLAuthPayload, constructing
LoadRequestMeta with database context when available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…h flow

Update JS test assertions to expect BaseMeta with database field instead
of null, and add Rust tests for database propagation through SQL query
meta and default absence when not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 pr:community Contribution from Cube.js community members. rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant