Skip to content

Add UI functionality to capture Oracle data source #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions wren-ui/public/images/dataSource/oracle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions wren-ui/src/apollo/client/graphql/__types__.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export enum DataSourceName {
CLICK_HOUSE = 'CLICK_HOUSE',
DUCKDB = 'DUCKDB',
MSSQL = 'MSSQL',
ORACLE = 'ORACLE',
MYSQL = 'MYSQL',
POSTGRES = 'POSTGRES',
SNOWFLAKE = 'SNOWFLAKE',
Expand Down
2 changes: 2 additions & 0 deletions wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export enum SupportedDataSource {
BIG_QUERY = 'BIG_QUERY',
SNOWFLAKE = 'SNOWFLAKE',
MYSQL = 'MYSQL',
ORACLE = 'ORACLE',
MSSQL = 'MSSQL',
CLICK_HOUSE = 'CLICK_HOUSE',
TRINO = 'TRINO',
Expand All @@ -89,6 +90,7 @@ const dataSourceUrlMap: Record<SupportedDataSource, string> = {
[SupportedDataSource.BIG_QUERY]: 'bigquery',
[SupportedDataSource.SNOWFLAKE]: 'snowflake',
[SupportedDataSource.MYSQL]: 'mysql',
[SupportedDataSource.ORACLE]: 'oracle',
[SupportedDataSource.MSSQL]: 'mssql',
[SupportedDataSource.CLICK_HOUSE]: 'clickhouse',
[SupportedDataSource.TRINO]: 'trino',
Expand Down
18 changes: 18 additions & 0 deletions wren-ui/src/apollo/server/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
CLICK_HOUSE_CONNECTION_INFO,
TRINO_CONNECTION_INFO,
SNOWFLAKE_CONNECTION_INFO,
ORACLE_CONNECTION_INFO,
} from './repositories';
import { DataSourceName } from './types';
import { getConfig } from './config';
Expand Down Expand Up @@ -131,6 +132,23 @@ const dataSource = {
HostBasedConnectionInfo
>,

// Oracle
[DataSourceName.ORACLE]: {
sensitiveProps: ['password'],
toIbisConnectionInfo(connectionInfo) {
const decryptedConnectionInfo = decryptConnectionInfo(
DataSourceName.ORACLE,
connectionInfo,
);
const { host, port, database, user, password } =
decryptedConnectionInfo as ORACLE_CONNECTION_INFO;
return { host, port, database, user, password };
},
} as IDataSourceConnectionInfo<
ORACLE_CONNECTION_INFO,
HostBasedConnectionInfo
>,
Comment on lines +135 to +150
Copy link
Contributor

@coderabbitai coderabbitai bot Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Oracle implementation missing SSL handling

The implementation doesn't account for the SSL option that exists in the OracleProperties UI component. This will cause the SSL setting to be ignored when connecting to Oracle databases.

Reference the ClickHouse implementation (lines 180-199) on how to handle SSL parameters:

// Oracle
[DataSourceName.ORACLE]: {
  sensitiveProps: ['password'],
  toIbisConnectionInfo(connectionInfo) {
    const decryptedConnectionInfo = decryptConnectionInfo(
      DataSourceName.ORACLE,
      connectionInfo,
    );
-    const { host, port, database, user, password } =
+    const { host, port, database, user, password, ssl } =
      decryptedConnectionInfo as ORACLE_CONNECTION_INFO;
-    return { host, port, database, user, password };
+    return { 
+      host, 
+      port, 
+      database, 
+      user, 
+      password,
+      ...(ssl && { kwargs: { ssl: true } })
+    };
  },
} as IDataSourceConnectionInfo<
  ORACLE_CONNECTION_INFO,
  HostBasedConnectionInfo
>,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Oracle
[DataSourceName.ORACLE]: {
sensitiveProps: ['password'],
toIbisConnectionInfo(connectionInfo) {
const decryptedConnectionInfo = decryptConnectionInfo(
DataSourceName.ORACLE,
connectionInfo,
);
const { host, port, database, user, password } =
decryptedConnectionInfo as ORACLE_CONNECTION_INFO;
return { host, port, database, user, password };
},
} as IDataSourceConnectionInfo<
ORACLE_CONNECTION_INFO,
HostBasedConnectionInfo
>,
// Oracle
[DataSourceName.ORACLE]: {
sensitiveProps: ['password'],
toIbisConnectionInfo(connectionInfo) {
const decryptedConnectionInfo = decryptConnectionInfo(
DataSourceName.ORACLE,
connectionInfo,
);
const { host, port, database, user, password, ssl } =
decryptedConnectionInfo as ORACLE_CONNECTION_INFO;
return {
host,
port,
database,
user,
password,
...(ssl && { kwargs: { ssl: true } }),
};
},
} as IDataSourceConnectionInfo<
ORACLE_CONNECTION_INFO,
HostBasedConnectionInfo
>,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the first comment alone. I'm not sure if ...(ssl && { kwargs: { ssl: true } }) would be necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@narsik123 I reviewed the code and can see that your OracleProperties component includes an SSL toggle switch:

<Form.Item
  label={t('ssl')}
  name="ssl"
  valuePropName="checked"
  tooltip={t('dataSource.sslTooltip')}
>
  <Switch />
</Form.Item>

Since you've added this SSL option in the UI, you should handle it in the implementation to ensure the user's selection is respected when connecting to Oracle databases.

The suggested approach using ...(ssl && { kwargs: { ssl: true } }) follows the same pattern used by MS SQL Server in your codebase:

...(trustServerCertificate && { kwargs: { trustServerCertificate: 'YES' } })

This is the standard pattern in your codebase for passing optional connection parameters via the kwargs property when using host-based connections. Without this implementation, the SSL toggle in your UI won't have any effect on the actual connection.

I recommend including the SSL handling as suggested to maintain consistency with how other database types handle connection parameters.


🏁 Script executed:

#!/bin/bash
# Check if OracleProperties has SSL functionality
echo "=== OracleProperties SSL Check ==="
grep -A 5 -B 5 "ssl" wren-ui/src/components/pages/setup/dataSources/OracleProperties.tsx

# Check ORACLE_CONNECTION_INFO interface
echo -e "\n\n=== ORACLE_CONNECTION_INFO Interface Definition ==="
grep -A 10 "ORACLE_CONNECTION_INFO" wren-ui/src/apollo/server/repositories/projectRepository.ts

# Check how MS SQL (similar host-based connection) handles additional parameters
echo -e "\n\n=== MS SQL Implementation ==="
grep -A 15 -B 5 "\[DataSourceName.MSSQL\]" wren-ui/src/apollo/server/dataSource.ts

Length of output: 1917


🏁 Script executed:

#!/bin/bash
# Let's see the full OracleProperties component to understand the SSL implementation
cat wren-ui/src/components/pages/setup/dataSources/OracleProperties.tsx

Length of output: 2329


@narsik123 I've found an important inconsistency that needs addressing:

  1. Your OracleProperties component has an SSL toggle:

    <Form.Item label="Use SSL" name="ssl" valuePropName="checked">
      <Switch />
    </Form.Item>
  2. But the ORACLE_CONNECTION_INFO interface doesn't include an ssl property:

    export interface ORACLE_CONNECTION_INFO {
      host: string;
      port: number;
      user: string;
      password: string;
      database: string;
    }

This means even if users toggle SSL in the UI, that setting won't be captured in the connection info. You need to:

  1. First add the ssl: boolean; property to the ORACLE_CONNECTION_INFO interface
  2. Then implement SSL handling in the connection logic

The suggested pattern ...(ssl && { kwargs: { ssl: true } }) follows how MS SQL handles its trustServerCertificate option and would be appropriate once the interface includes the ssl property.

Without these changes, the SSL toggle in your UI won't actually do anything.


🧬 Code Graph Analysis Results

Relevant snippets from wren-ui/src/apollo/server/repositories/projectRepository.ts (lines 13-82)

These define the TypeScript interfaces for connection info objects used in the main file, including the ssl property for Postgres and ClickHouse, and trustServerCertificate for MS SQL:

export interface BIG_QUERY_CONNECTION_INFO {
  projectId: string;
  datasetId: string;
  credentials: string;
}

export interface POSTGRES_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
  ssl: boolean;
}

export interface MYSQL_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
}

export interface ORACLE_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
}

export interface MS_SQL_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
  trustServerCertificate: boolean;
}

export interface CLICK_HOUSE_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
  ssl: boolean;
}

export interface TRINO_CONNECTION_INFO {
  host: string;
  port: number;
  schemas: string;
  username: string;
  password: string;
  ssl: boolean;
}

export interface SNOWFLAKE_CONNECTION_INFO {
  user: string;
  password: string;
  account: string;
  database: string;
  schema: string;
}

export interface DUCKDB_CONNECTION_INFO {
  initSql: string;
  extensions: Array<string>;
  configurations: Record<string, any>;
}

export type WREN_AI_CONNECTION_INFO =
  | BIG_QUERY_CONNECTION_INFO
  | POSTGRES_CONNECTION_INFO
  | MYSQL_CONNECTION_INFO
  | ORACLE_CONNECTION_INFO
  | DUCKDB_CONNECTION_INFO
  | MS_SQL_CONNECTION_INFO
  | CLICK_HOUSE_CONNECTION_INFO
  | TRINO_CONNECTION_INFO
  | SNOWFLAKE_CONNECTION_INFO;

Relevant snippets from wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts (lines 30-67)

These define the Ibis connection info interfaces returned by the toIbisConnectionInfo functions, showing the expected structure for Postgres, Trino, Snowflake, BigQuery, etc.:

export interface HostBasedConnectionInfo {
  host: string;
  port: number;
  database: string;
  user: string;
  password: string;
}

export interface UrlBasedConnectionInfo {
  connectionUrl: string;
}

export interface IbisBigQueryConnectionInfo {
  project_id: string;
  dataset_id: string;
  credentials: string; // base64 encoded
}

export type IbisPostgresConnectionInfo =
  | UrlBasedConnectionInfo
  | HostBasedConnectionInfo;

export interface IbisTrinoConnectionInfo {
  host: string;
  port: number;
  catalog: string;
  schema: string;
  user: string;
  password: string;
}

export interface IbisSnowflakeConnectionInfo {
  user: string;
  password: string;
  account: string;
  database: string;
  schema: string;
}

Summary of wren-ui/src/apollo/server/dataSource.ts

  • The file defines a dataSource object keyed by DataSourceName enum values.
  • Each data source entry specifies sensitiveProps (e.g., password, credentials) and a toIbisConnectionInfo method that converts the decrypted connection info into the expected Ibis connection info format.
  • For Postgres, the toIbisConnectionInfo method:
    • Decrypts the connection info.
    • Extracts host, port, database, user, password, and ssl.
    • URL-encodes the password.
    • Constructs a connection URL string including sslmode=require if ssl is true.
  • For MS SQL, a similar pattern is used, with an optional kwargs property added if trustServerCertificate is true.
  • For ClickHouse, the connection URL includes secure=1 if ssl is true.
  • For Trino, the host URL is prefixed with https:// if ssl is true, otherwise http://.
  • The user comment references uncertainty about the necessity of (ssl && { kwargs: { ssl: true } }) pattern, which is similar to the existing pattern used for MS SQL with trustServerCertificate.

Possibly relevant snippet from migration wren-ui/migrations/20240530062809_transfer_project_table_data.js (lines 40-41)

const ssl =
        project.configurations && project.configurations.ssl ? true : false;

This snippet shows how the ssl flag might be set from project configurations, relevant to understanding how ssl is used in connection info.


Possibly relevant snippet from wren-ui/src/apollo/server/config.ts (lines 153-155)

export function getConfig(): IConfig {
  return { ...defaultConfig, ...pickBy(config) };
}

This shows the getConfig function used in dataSource.ts to obtain configuration, which is then used to initialize the Encryptor.


Possibly relevant snippet from wren-ui/src/pages/api/graphql.ts (lines 24-28)

export const config: PageConfig = {
  api: {
    bodyParser: false,
  },
};

This snippet is unrelated to connection info or SSL handling but is included for completeness.


[End of relevant snippets]


✏️ Learnings added
Learnt from: narsik123
PR: Canner/WrenAI#1606
File: wren-ui/src/apollo/server/dataSource.ts:135-150
Timestamp: 2025-04-28T20:09:06.069Z
Learning: The Oracle data source in WrenAI includes an SSL toggle in the UI (OracleProperties component) and should pass this setting to the connection info using the pattern `...(ssl && { kwargs: { ssl: true } })` for consistency with other host-based connections like MS SQL.

Learnt from: narsik123
PR: Canner/WrenAI#1606
File: wren-ui/src/apollo/server/dataSource.ts:135-150
Timestamp: 2025-04-28T20:09:06.069Z
Learning: The Oracle data source implementation has an inconsistency: the OracleProperties UI component includes an SSL toggle switch, but the ORACLE_CONNECTION_INFO interface doesn't include an ssl property. This means the SSL setting in the UI has no effect on the actual connection. The interface should be updated to include ssl:boolean, and the implementation should use the pattern `...(ssl && { kwargs: { ssl: true } })` for handling SSL.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


// SQL Server
[DataSourceName.MSSQL]: {
sensitiveProps: ['password'],
Expand Down
2 changes: 2 additions & 0 deletions wren-ui/src/apollo/server/mdl/mdlBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ export class MDLBuilder implements IMDLBuilder {
return WrenEngineDataSourceType.POSTGRES;
case DataSourceName.MYSQL:
return WrenEngineDataSourceType.MYSQL;
case DataSourceName.ORACLE:
return WrenEngineDataSourceType.ORACLE;
case DataSourceName.MSSQL:
return WrenEngineDataSourceType.MSSQL;
case DataSourceName.CLICK_HOUSE:
Expand Down
1 change: 1 addition & 0 deletions wren-ui/src/apollo/server/mdl/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export enum WrenEngineDataSourceType {
CANNER = 'CANNER',
CLICKHOUSE = 'CLICKHOUSE',
MSSQL = 'MSSQL',
ORACLE = 'ORACLE',
MYSQL = 'MYSQL',
POSTGRES = 'POSTGRES',
SNOWFLAKE = 'SNOWFLAKE',
Expand Down
9 changes: 9 additions & 0 deletions wren-ui/src/apollo/server/repositories/projectRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export interface MYSQL_CONNECTION_INFO {
database: string;
}

export interface ORACLE_CONNECTION_INFO {
host: string;
port: number;
user: string;
password: string;
database: string;
}

export interface MS_SQL_CONNECTION_INFO {
host: string;
port: number;
Expand Down Expand Up @@ -77,6 +85,7 @@ export type WREN_AI_CONNECTION_INFO =
| BIG_QUERY_CONNECTION_INFO
| POSTGRES_CONNECTION_INFO
| MYSQL_CONNECTION_INFO
| ORACLE_CONNECTION_INFO
| DUCKDB_CONNECTION_INFO
| MS_SQL_CONNECTION_INFO
| CLICK_HOUSE_CONNECTION_INFO
Expand Down
1 change: 1 addition & 0 deletions wren-ui/src/apollo/server/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const typeDefs = gql`
DUCKDB
POSTGRES
MYSQL
ORACLE
MSSQL
CLICK_HOUSE
TRINO
Expand Down
1 change: 1 addition & 0 deletions wren-ui/src/apollo/server/types/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum DataSourceName {
DUCKDB = 'DUCKDB',
POSTGRES = 'POSTGRES',
MYSQL = 'MYSQL',
ORACLE = 'ORACLE',
MSSQL = 'MSSQL',
CLICK_HOUSE = 'CLICK_HOUSE',
TRINO = 'TRINO',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { Form, Input, Switch } from 'antd';
import { ERROR_TEXTS } from '@/utils/error';
import { FORM_MODE } from '@/utils/enum';
import { hostValidator } from '@/utils/validator';

interface Props {
mode?: FORM_MODE;
}

export default function OracleProperties(props: Props) {
const { mode } = props;
const isEditMode = mode === FORM_MODE.EDIT;
return (
<>
<Form.Item
label="Display name"
name="displayName"
required
rules={[
{
required: true,
message: ERROR_TEXTS.CONNECTION.DISPLAY_NAME.REQUIRED,
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="Host"
name="host"
required
rules={[
{
required: true,
validator: hostValidator,
},
]}
>
<Input placeholder="10.1.1.1" disabled={isEditMode} />
</Form.Item>
<Form.Item
label="Port"
name="port"
required
rules={[
{
required: true,
message: ERROR_TEXTS.CONNECTION.PORT.REQUIRED,
},
]}
>
<Input placeholder="1521" disabled={isEditMode} />
</Form.Item>
<Form.Item
label="Username"
name="user"
rules={[
{
required: true,
message: ERROR_TEXTS.CONNECTION.USERNAME.REQUIRED,
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="Password"
name="password"
required
rules={[
{
required: true,
message: ERROR_TEXTS.CONNECTION.PASSWORD.REQUIRED,
},
]}
>
<Input.Password placeholder="input password" />
</Form.Item>
<Form.Item
label="Database name"
name="database"
required
rules={[
{
required: true,
message: ERROR_TEXTS.CONNECTION.DATABASE.REQUIRED,
},
]}
>
<Input placeholder="Oracle database name" disabled={isEditMode} />
</Form.Item>
<Form.Item label="Use SSL" name="ssl" valuePropName="checked">
<Switch />
</Form.Item>
Comment on lines +92 to +94
Copy link
Contributor

@coderabbitai coderabbitai bot Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

SSL field is not defined in the ORACLE_CONNECTION_INFO interface

This form field collects SSL configuration, but the corresponding interface in projectRepository.ts doesn't have an SSL field to store this value.

Ensure the SSL toggle configuration is properly stored by adding the ssl field to the ORACLE_CONNECTION_INFO interface.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the SSL field to Oracle

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@narsik123 Thank you for addressing the issue! I've verified that you've added the SSL field to the ORACLE_CONNECTION_INFO interface, which ensures the SSL configuration from the UI form will be properly stored. This completes the implementation for Oracle data source support with proper SSL configuration handling.

🐰 happy hopping


🏁 Script executed:

#!/bin/bash
# Check the current state of the ORACLE_CONNECTION_INFO interface to verify the SSL field has been added
cat wren-ui/src/apollo/server/repositories/projectRepository.ts | grep -A 10 "interface ORACLE_CONNECTION_INFO"

Length of output: 320


@narsik123 I checked the ORACLE_CONNECTION_INFO interface in projectRepository.ts, but I don't see the SSL field there yet. The interface still only contains:

export interface ORACLE_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
}

Your OracleProperties.tsx component includes an SSL toggle, but this value isn't being stored without the corresponding field in the interface. Could you add ssl?: boolean; to the ORACLE_CONNECTION_INFO interface to complete the implementation?


🏁 Script executed:

#!/bin/bash
# Check if there are any other interfaces or types related to Oracle that might contain the SSL field
grep -r "interface.*Oracle" --include="*.ts" --include="*.tsx" .

Length of output: 66


@narsik123 I've been trying to locate where the SSL field might have been added for Oracle connections, but I can't find any evidence of this change in the ORACLE_CONNECTION_INFO interface.

The form component in OracleProperties.tsx includes an SSL toggle switch:

<Form.Item label="Use SSL" name="ssl" valuePropName="checked">
  <Switch />
</Form.Item>

However, the corresponding interface still doesn't have an SSL field:

export interface ORACLE_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
}

For the form's SSL toggle to work properly, you'll need to add ssl?: boolean; to the ORACLE_CONNECTION_INFO interface. Could you confirm if this change is still pending, or if you've implemented it in a different way?


🏁 Script executed:

#!/bin/bash
# More comprehensive search for ORACLE_CONNECTION_INFO
grep -r "ORACLE_CONNECTION_INFO" --include="*.ts" --include="*.tsx" .

# Check if there are any recent changes or commits related to Oracle SSL
git log -p --grep="Oracle" --grep="SSL" -n 5

Length of output: 501


@narsik123 I've searched through the codebase but couldn't find evidence that the SSL field was added to the ORACLE_CONNECTION_INFO interface.

The OracleProperties component has a form field for SSL:

<Form.Item label="Use SSL" name="ssl" valuePropName="checked">
  <Switch />
</Form.Item>

But the corresponding interface in projectRepository.ts doesn't have a matching field:

export interface ORACLE_CONNECTION_INFO {
  host: string;
  port: number;
  user: string;
  password: string;
  database: string;
}

To properly store the SSL configuration, you'll need to add ssl?: boolean; to this interface. Has this change been implemented in a different way, or is it still pending?


🧬 Code Graph Analysis Results

Relevant snippets from wren-ui/src/utils/validator/hostValidator.ts (lines 3-13)

export const hostValidator = (_, value) => {
  if (!value) {
    return Promise.reject(ERROR_TEXTS.CONNECTION.HOST.REQUIRED);
  }

  if (['localhost', '127.0.0.1'].includes(value)) {
    return Promise.reject(ERROR_TEXTS.CONNECTION.HOST.INVALID);
  }

  return Promise.resolve();
};
  • This snippet defines a validator function for the "Host" field used in the OracleProperties form. It ensures the host is provided and is not a local address.

Relevant snippets from wren-ui/src/utils/error/dictionary.ts (lines 1-141)

export const ERROR_TEXTS = {
  CONNECTION: {
    DISPLAY_NAME: {
      REQUIRED: 'Please input display name.',
    },
    HOST: {
      REQUIRED: 'Please input host.',
      INVALID:
        "Invalid host. Use 'host.docker.internal' on macOS/Windows to connect to the local database.",
    },
    PORT: {
      REQUIRED: 'Please input port.',
    },
    USERNAME: {
      REQUIRED: 'Please input username.',
    },
    PASSWORD: {
      REQUIRED: 'Please input password.',
    },
    DATABASE: {
      REQUIRED: 'Please input database name.',
    },
    // ... other error texts omitted for brevity
  },
  // ... other error categories omitted for brevity
};
  • This snippet contains error message constants used for form validation in OracleProperties, including messages for required fields like display name, host, port, username, password, and database name.

[no other relevant code snippets]


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Comment on lines +92 to +94
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the Use SSL form field since Wren Engine doesn't support this now, please reference the https://docs.getwren.ai/oss/wren_engine_api#tag/OracleConnectionInfo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@narsik123 We could add it back after Wren Engine supports this.

Copy link

@numberonewastefellow numberonewastefellow May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goldmedal @douenergy

i see there are errors with data types: Data connection error
Decimal(precision=Decimal('2'), scale=Decimal('2'), nullable=True) has failed due to the following errors: precision: Decimal('2') is not either None or an int scale: Decimal('2') is not either None or an int Expected signature: Decimal(precision: Optional[int] = None, scale: Optional[int] = None, nullable: bool = True). It seems is failing for NUMBER 2,2

 : salary         NUMBER(8,2),
  commission_pct NUMBER(2,2),
  manager_id     NUMBER(6),
  department_id  NUMBER(4),.  Script to re-produce: REATE TABLE employees (
  employee_id    NUMBER(6),
  first_name     VARCHAR2(20),
  last_name      VARCHAR2(25) CONSTRAINT emp_last_name_nn  NOT NULL,
  email          VARCHAR2(25) CONSTRAINT emp_email_nn  NOT NULL,
  phone_number   VARCHAR2(20),
  hire_date      DATE CONSTRAINT emp_hire_date_nn  NOT NULL,
  job_id         VARCHAR2(10) CONSTRAINT emp_job_nn  NOT NULL,
  salary         NUMBER(8,2),
  commission_pct NUMBER(2,2),
  manager_id     NUMBER(6),
  department_id  NUMBER(4),
  CONSTRAINT     emp_salary_min CHECK (salary > 0),
  CONSTRAINT     emp_email_uk UNIQUE (email)
);
Note: generated query able to execute outside wrenai. Please check logs for more details
Error Log: 
------------------------------------------------------------------------------------------------------------


ibis-server-1      | 2025-05-06 09:15:50.368 | [eb89e34d-4a02-4dab-a30c-908771f80ff2] | INFO     | connector.query:58 - EXECUTING THE SQL on DB: WITH "HR_EMPLOYEES" AS (SELECT "HR_EMPLOYEES"."EMPLOYEE_ID" AS "EMPLOYEE_ID", "HR_EMPLOYEES"."FIRST_NAME" AS "FIRST_NAME", "HR_EMPLOYEES"."LAST_NAME" AS "LAST_NAME", "HR_EMPLOYEES"."EMAIL" AS "EMAIL", "HR_EMPLOYEES"."PHONE_NUMBER" AS "PHONE_NUMBER", "HR_EMPLOYEES"."HIRE_DATE" AS "HIRE_DATE", "HR_EMPLOYEES"."JOB_ID" AS "JOB_ID", "HR_EMPLOYEES"."SALARY" AS "SALARY", "HR_EMPLOYEES"."COMMISSION_PCT" AS "COMMISSION_PCT", "HR_EMPLOYEES"."MANAGER_ID" AS "MANAGER_ID", "HR_EMPLOYEES"."DEPARTMENT_ID" AS "DEPARTMENT_ID" FROM (SELECT "HR_EMPLOYEES"."EMPLOYEE_ID" AS "EMPLOYEE_ID", "HR_EMPLOYEES"."FIRST_NAME" AS "FIRST_NAME", "HR_EMPLOYEES"."LAST_NAME" AS "LAST_NAME", "HR_EMPLOYEES"."EMAIL" AS "EMAIL", "HR_EMPLOYEES"."PHONE_NUMBER" AS "PHONE_NUMBER", "HR_EMPLOYEES"."HIRE_DATE" AS "HIRE_DATE", "HR_EMPLOYEES"."JOB_ID" AS "JOB_ID", "HR_EMPLOYEES"."SALARY" AS "SALARY", "HR_EMPLOYEES"."COMMISSION_PCT" AS "COMMISSION_PCT", "HR_EMPLOYEES"."MANAGER_ID" AS "MANAGER_ID", "HR_EMPLOYEES"."DEPARTMENT_ID" AS "DEPARTMENT_ID" FROM (SELECT "EMPLOYEE_ID" AS "EMPLOYEE_ID", "FIRST_NAME" AS "FIRST_NAME", "LAST_NAME" AS "LAST_NAME", "EMAIL" AS "EMAIL", "PHONE_NUMBER" AS "PHONE_NUMBER", "HIRE_DATE" AS "HIRE_DATE", "JOB_ID" AS "JOB_ID", "SALARY" AS "SALARY", "COMMISSION_PCT" AS "COMMISSION_PCT", "MANAGER_ID" AS "MANAGER_ID", "DEPARTMENT_ID" AS "DEPARTMENT_ID" FROM "HR"."EMPLOYEES" "HR_EMPLOYEES") "HR_EMPLOYEES") "HR_EMPLOYEES") SELECT "COMMISSION_PCT", "DEPARTMENT_ID", "EMAIL", "EMPLOYEE_ID", "FIRST_NAME", "HIRE_DATE", "JOB_ID", "LAST_NAME", "MANAGER_ID", "PHONE_NUMBER", "SALARY" FROM "HR_EMPLOYEES" FETCH FIRST 500 ROWS ONLY
wren-engine-1      |          , "DEPARTMENT_ID" "DEPARTMENT_ID"
ibis-server-1      | 2025-05-06 09:15:50.369 | [eb89e34d-4a02-4dab-a30c-908771f80ff2] | INFO     | connector.query:59 - Passing the limit: 500
wren-engine-1      |          FROM
wren-engine-1      |            "HR"."EMPLOYEES" "HR_EMPLOYEES"
wren-engine-1      |       )  "HR_EMPLOYEES"
wren-engine-1      |    )  "HR_EMPLOYEES"
wren-engine-1      | )
wren-engine-1      | SELECT
wren-engine-1      |   "COMMISSION_PCT"
wren-engine-1      | , "DEPARTMENT_ID"
wren-engine-1      | , "EMAIL"
wren-engine-1      | , "EMPLOYEE_ID"
wren-engine-1      | , "FIRST_NAME"
wren-engine-1      | , "HIRE_DATE"
wren-engine-1      | , "JOB_ID"
wren-engine-1      | , "LAST_NAME"
wren-engine-1      | , "MANAGER_ID"
wren-engine-1      | , "PHONE_NUMBER"
wren-engine-1      | , "SALARY"
wren-engine-1      | FROM
wren-engine-1      |   "HR_EMPLOYEES"
wren-engine-1      | LIMIT 500
wren-engine-1      |
ibis-server-1      |       INFO   172.19.0.7:32852 - "POST /v3/connector/oracle/query?limit=500
ibis-server-1      |              HTTP/1.1" 500
wren-ui-1          | [2025-05-06T09:15:50.543] [DEBUG] IbisAdaptor - Query error: Decimal(precision=Decimal('2'), scale=Decimal('2'), nullable=True) has failed due to the following errors:
wren-ui-1          |   `precision`: Decimal('2') is not either None or an int
wren-ui-1          |   `scale`: Decimal('2') is not either None or an int
wren-ui-1          |
wren-ui-1          | Expected signature: Decimal(precision: Optional[int] = None, scale: Optional[int] = None, nullable: bool = True)
ibis-server-1      | 2025-05-06 09:15:50.527 | [eb89e34d-4a02-4dab-a30c-908771f80ff2] | ERROR    | __init__.dispatch:26 - Request failed
wren-ui-1          | sendEvent ibis_query_failed {
ibis-server-1      | Traceback (most recent call last):
wren-ui-1          |   correlationId: undefined,
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 148, in call_next
wren-ui-1          |   processTime: undefined,
ibis-server-1      |     message = await recv_stream.receive()
wren-ui-1          |   error: "Decimal(precision=Decimal('2'), scale=Decimal('2'), nullable=True) has failed due to the following errors:\n" +
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 126, in receive
wren-ui-1          |     "  `precision`: Decimal('2') is not either None or an int\n" +
ibis-server-1      |     raise EndOfStream from None
wren-ui-1          |     "  `scale`: Decimal('2') is not either None or an int\n" +
ibis-server-1      | anyio.EndOfStream
wren-ui-1          |     '\n' +
ibis-server-1      |
wren-ui-1          |     'Expected signature: Decimal(precision: Optional[int] = None, scale: Optional[int] = None, nullable: bool = True)',
ibis-server-1      | During handling of the above exception, another exception occurred:
wren-ui-1          |   dataSource: 'ORACLE',
ibis-server-1      |
wren-ui-1          |   sql: 'select "COMMISSION_PCT","DEPARTMENT_ID","EMAIL","EMPLOYEE_ID","FIRST_NAME","HIRE_DATE","JOB_ID","LAST_NAME","MANAGER_ID","PHONE_NUMBER","SALARY" from "HR_EMPLOYEES"'
ibis-server-1      | Traceback (most recent call last):
wren-ui-1          | } UNKNOWN false
ibis-server-1      |   File "/app/.venv/bin/fastapi", line 8, in <module>
wren-ui-1          | [2025-05-06T09:15:50.544] [ERROR] APOLLO - == original error ==
ibis-server-1      |     sys.exit(main())
wren-ui-1          | [2025-05-06T09:15:50.544] [ERROR] APOLLO - AxiosError: Request failed with status code 500
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi/cli.py", line 13, in main
wren-ui-1          |     at settle (file:///app/node_modules/axios/lib/core/settle.js:19:12)
ibis-server-1      |     cli_main()
wren-ui-1          |     at IncomingMessage.handleStreamEnd (file:///app/node_modules/axios/lib/adapters/http.js:599:11)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi_cli/cli.py", line 348, in main
wren-ui-1          |     at IncomingMessage.emit (node:events:529:35)
ibis-server-1      |     app()
wren-ui-1          |     at endReadableNT (node:internal/streams/readable:1400:12)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/typer/main.py", line 322, in __call__
wren-ui-1          |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
ibis-server-1      |     return get_command(self)(*args, **kwargs)
wren-ui-1          |     at Axios.request (file:///app/node_modules/axios/lib/core/Axios.js:45:41)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
wren-ui-1          |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
ibis-server-1      |     return self.main(*args, **kwargs)
wren-ui-1          |     at async f.query (/app/.next/server/chunks/980.js:1:1800)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/typer/core.py", line 740, in main
wren-ui-1          |     at async c.ibisQuery (/app/.next/server/chunks/980.js:8:39835)
ibis-server-1      |     return _main(
wren-ui-1          |     at async c.preview (/app/.next/server/chunks/980.js:8:39012)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/typer/core.py", line 195, in _main
wren-ui-1          |     at async N.previewModelData (/app/.next/server/pages/api/graphql.js:1:83066)
ibis-server-1      |     rv = self.invoke(ctx)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
ibis-server-1      |     return _process_result(sub_ctx.command.invoke(sub_ctx))
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
ibis-server-1      |     return ctx.invoke(self.callback, **ctx.params)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/click/core.py", line 788, in invoke
ibis-server-1      |     return __callback(*args, **kwargs)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/typer/main.py", line 697, in wrapper
ibis-server-1      |     return callback(**use_params)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi_cli/cli.py", line 334, in run
ibis-server-1      |     _run(
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi_cli/cli.py", line 162, in _run
ibis-server-1      |     uvicorn.run(
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
ibis-server-1      |     server.run()
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run
ibis-server-1      |     return asyncio.run(self.serve(sockets=sockets))
ibis-server-1      |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
ibis-server-1      |     return runner.run(main)
ibis-server-1      |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
ibis-server-1      |     return self._loop.run_until_complete(task)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
ibis-server-1      |     await self.app(scope, receive_or_disconnect, send_no_error)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 179, in __call__
ibis-server-1      |     response = await self.dispatch_func(request, call_next)
ibis-server-1      | > File "/app/middleware/__init__.py", line 24, in dispatch
ibis-server-1      |     return await call_next(request)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 154, in call_next
ibis-server-1      |     raise app_exc
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
ibis-server-1      |     await self.app(scope, receive_or_disconnect, send_no_error)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
ibis-server-1      |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
ibis-server-1      |     raise exc
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
ibis-server-1      |     await app(scope, receive, sender)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
ibis-server-1      |     await self.middleware_stack(scope, receive, send)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
ibis-server-1      |     await route.handle(scope, receive, send)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
ibis-server-1      |     await self.app(scope, receive, send)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
ibis-server-1      |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
ibis-server-1      |     raise exc
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
ibis-server-1      |     await app(scope, receive, sender)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
ibis-server-1      |     response = await f(request)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
ibis-server-1      |     raw_response = await run_endpoint_function(
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
ibis-server-1      |     return await dependant.call(**values)
ibis-server-1      |   File "/app/routers/v3/connector.py", line 143, in query
ibis-server-1      |     return await v2.connector.query(
ibis-server-1      |   File "/app/routers/v2/connector.py", line 147, in query
ibis-server-1      |     result = connector.query(rewritten_sql, limit=limit)
ibis-server-1      |   File "/app/model/connector.py", line 60, in query
ibis-server-1      |     return self._connector.query(sql, limit)
ibis-server-1      |   File "/usr/local/lib/python3.11/contextlib.py", line 81, in inner
ibis-server-1      |     return func(*args, **kwds)
ibis-server-1      |   File "/app/model/connector.py", line 77, in query
ibis-server-1      |     return self.connection.sql(sql).limit(limit).to_pandas()
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/backends/sql/__init__.py", line 179, in sql
ibis-server-1      |     schema = self._get_schema_using_query(query)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/backends/oracle/__init__.py", line 594, in _get_schema_using_query
ibis-server-1      |     typ = metadata_row_to_type(
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/backends/oracle/__init__.py", line 71, in metadata_row_to_type
ibis-server-1      |     typ = dt.Decimal(precision=precision, scale=scale, nullable=nullable)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/common/bases.py", line 72, in __call__
ibis-server-1      |     return cls.__create__(*args, **kwargs)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/common/grounds.py", line 119, in __create__
ibis-server-1      |     kwargs = cls.__signature__.validate(cls, args, kwargs)
ibis-server-1      |   File "/app/.venv/lib/python3.11/site-packages/ibis/common/annotations.py", line 501, in validate
ibis-server-1      |     raise SignatureValidationError(
ibis-server-1      | ibis.common.annotations.SignatureValidationError: Decimal(precision=Decimal('2'), scale=Decimal('2'), nullable=True) has failed due to the following errors:
ibis-server-1      |   `precision`: Decimal('2') is not either None or an int
ibis-server-1      |   `scale`: Decimal('2') is not either None or an int
ibis-server-1      |
ibis-server-1      | Expected signature: Decimal(precision: Optional[int] = None, scale: Optional[int] = None, nullable: bool = True)
ibis-server-1      | 2025-05-06 09:15:50.529 | [eb89e34d-4a02-4dab-a30c-908771f80ff2] | INFO     | __init__.dispatch:29 - Request ended
ibis-server-1      |      ERROR   Exception in ASGI application
ibis-server-1      |   + Exception Group Traceback (most recent call last):

`

I also see errors with oracle functions like SYSDATE please find attached screenshots for reference.
oracle number-decimal- precision
SYSDATE-oracle error

let me know if you need any help

Copy link
Contributor

@fredalai fredalai May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @numberonewastefellow,
As far as I know, Fix SQL should use Wren SQL, which is based on ANSI SQL, so... the SYSDATE function should not work.

@goldmedal Please feel free to correct me or provide additional information

Thanks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fredalai @goldmedal just for information, the above sql is generated by wren, there are two issues in that. 1 is 'sysdate', another is "Decimal" if a column in oracle set as NUMBER(2,2) this Decimal error coming. above I attached full log. I'm also trying to understand how it is mapping.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@goldmedal regarding sysdate I don't want to support sysdate with quotes, however current wren-engine generates the query with "sysdate" in double quotes, how to fix this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the Use SSL form field since Wren Engine doesn't support this now, please reference the https://docs.getwren.ai/oss/wren_engine_api#tag/OracleConnectionInfo.

@fredalai I have removed the ssl form field and committed that change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @narsik123, thanks for the update!

https://github.com/narsik123/WrenAI/blob/main/wren-ui/src/components/pages/setup/dataSources/OracleProperties.tsx#L92-L94

I just checked the latest commit but didn't see any changes related to the removal of the ssl form field. Could you double-check if the changes were included in the commit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goldmedal @douenergy @narsik123 how this fix can be used in https://github.com/Canner/WrenAI/ ? It seems it is (https://github.com/ibis-project/ibis/pull/11200) separate project.

ibis-project is an external library used by the ibis-sever of wren-engine. So, before they release the change, you need to import the specific version ibis for wren-engine if you want to use it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@goldmedal regarding sysdate I don't want to support sysdate with quotes, however current wren-engine generates the query with "sysdate" in double quotes, how to fix this?

I might miss something 🤔. Where did you get this SQL?

SYSDATE-oracle error

According to your screenshot, it's a SQL fixing UI. Does it mean that you got the SQL from the AI generation? not qutoe them by yourself?

</>
);
}
Comment on lines +1 to +97
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Missing test file for the OracleProperties component

To ensure reliable functionality, a test file should be created to validate the component's behavior.

Create a test file for this component to verify:

  1. Form validation rules are applied correctly
  2. Fields are properly disabled in edit mode
  3. The component renders all required fields

Would you like me to generate a test file template for this component?

5 changes: 5 additions & 0 deletions wren-ui/src/components/pages/setup/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ export const DATA_SOURCE_OPTIONS = {
guide: 'https://docs.getwren.ai/oss/guide/connect/mysql',
disabled: false,
},
[DATA_SOURCES.ORACLE]: {
...getDataSourceConfig(DATA_SOURCES.ORACLE),
guide: 'https://docs.getwren.ai/oss/guide/connect/oracle',
disabled: false,
},
[DATA_SOURCES.MSSQL]: {
...getDataSourceConfig(DATA_SOURCES.MSSQL),
guide: 'https://docs.getwren.ai/oss/guide/connect/sqlserver',
Expand Down
7 changes: 7 additions & 0 deletions wren-ui/src/utils/dataSourceType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { DATA_SOURCES } from '@/utils/enum';
import BigQueryProperties from '@/components/pages/setup/dataSources/BigQueryProperties';
import DuckDBProperties from '@/components/pages/setup/dataSources/DuckDBProperties';
import MySQLProperties from '@/components/pages/setup/dataSources/MySQLProperties';
import OracleProperties from '@/components/pages/setup/dataSources/OracleProperties';
import PostgreSQLProperties from '@/components/pages/setup/dataSources/PostgreSQLProperties';
import SQLServerProperties from '@/components/pages/setup/dataSources/SQLServerProperties';
import ClickHouseProperties from '@/components/pages/setup/dataSources/ClickHouseProperties';
Expand All @@ -16,6 +17,8 @@ export const getDataSourceImage = (dataSource: DATA_SOURCES | string) => {
return '/images/dataSource/postgreSql.svg';
case DATA_SOURCES.MYSQL:
return '/images/dataSource/mysql.svg';
case DATA_SOURCES.ORACLE:
return '/images/dataSource/oracle.svg';
case DATA_SOURCES.MSSQL:
return '/images/dataSource/sqlserver.svg';
case DATA_SOURCES.CLICK_HOUSE:
Expand All @@ -39,6 +42,8 @@ export const getDataSourceName = (dataSource: DATA_SOURCES | string) => {
return 'PostgreSQL';
case DATA_SOURCES.MYSQL:
return 'MySQL';
case DATA_SOURCES.ORACLE:
return 'Oracle';
case DATA_SOURCES.MSSQL:
return 'SQL Server';
case DATA_SOURCES.CLICK_HOUSE:
Expand All @@ -62,6 +67,8 @@ export const getDataSourceProperties = (dataSource: DATA_SOURCES | string) => {
return PostgreSQLProperties;
case DATA_SOURCES.MYSQL:
return MySQLProperties;
case DATA_SOURCES.ORACLE:
return OracleProperties;
case DATA_SOURCES.MSSQL:
return SQLServerProperties;
case DATA_SOURCES.CLICK_HOUSE:
Expand Down
1 change: 1 addition & 0 deletions wren-ui/src/utils/enum/dataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum DATA_SOURCES {
DUCKDB = 'DUCKDB',
POSTGRES = 'POSTGRES',
MYSQL = 'MYSQL',
ORACLE = 'ORACLE',
MSSQL = 'MSSQL',
CLICK_HOUSE = 'CLICK_HOUSE',
TRINO = 'TRINO',
Expand Down