Skip to content

fix(datasource): persist BigQuery project, email, and keyfile fields#2179

Open
Hamza-ali1223 wants to merge 2 commits into
OtterMind:mainfrom
Hamza-ali1223:fix/bigquery-persistence-fields
Open

fix(datasource): persist BigQuery project, email, and keyfile fields#2179
Hamza-ali1223 wants to merge 2 commits into
OtterMind:mainfrom
Hamza-ali1223:fix/bigquery-persistence-fields

Conversation

@Hamza-ali1223

Copy link
Copy Markdown
Contributor

Closes #2178

Problem

When creating or editing a Google BigQuery connection in Chat2DB Community Edition, the form collects three custom authentication fields: project, email, and keyfile.

While Test connection succeeds using in-memory form values, clicking Save drops these three fields because they were not declared on the persistence models. As a result:

  • Reopening Edit Connection shows empty Project, Account email, and Key file inputs.
  • Running queries from Query Console fails with java.sql.SQLException: Required Connection Key(s): ProjectId.

Root Cause

  1. BigQueryDBManager.java expects connectInfo.getProject(), connectInfo.getEmail(), and connectInfo.getKeyfile() to populate Simba JDBC driver properties (ProjectId, OAuthServiceAcctEmail, OAuthPvtKeyPath).
  2. DataSource.java (domain entity) and DataSourceUpdateRequest.java (web DTO) lacked declarations for project, email, and keyfile.
  3. MyBatis and Jackson dropped these fields during save and update operations.

Proposed Changes

Added the three missing fields with Lombok getters/setters to:

  • chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/src/main/java/ai/chat2db/community/domain/api/model/datasource/DataSource.java
  • chat2db-community-server/chat2db-community-web/src/main/java/ai/chat2db/community/web/api/model/request/data/source/DataSourceUpdateRequest.java

These changes are additive, backwards-compatible, and do not alter existing fields.

Verification

  1. Started local Community backend (port 10825) and frontend (port 8889).
  2. Saved a new BigQuery connection with valid Project ID, service account email, and JSON keyfile path.
  3. Reopened Edit Connection and confirmed all three fields remained populated.
  4. Opened Query Console and ran SELECT 1 AS ok;. The query executed successfully and returned 1.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[Bug] BigQuery connection custom parameters (Project ID, Email, Keyfile) are not persisted on save

3 participants