Skip to content

Create connector files #7726

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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
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
Prev Previous commit
Next Next commit
centralize sources and olap connectors to constants
  • Loading branch information
lovincyrus committed Aug 8, 2025
commit e67e4636bfb23cc17a9c76a88e501219d7e8ae32
23 changes: 1 addition & 22 deletions web-common/src/features/sources/modal/AddDataModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,13 @@
import DuplicateSource from "./DuplicateSource.svelte";
import LocalSourceUpload from "./LocalSourceUpload.svelte";
import RequestConnectorForm from "./RequestConnectorForm.svelte";
import { OLAP_CONNECTORS, SORT_ORDER, SOURCES } from "./constants";

let step = 0;
let selectedConnector: null | V1ConnectorDriver = null;
let requestConnector = false;
let isSubmittingForm = false;

const SOURCES = [
"gcs",
"s3",
"azure",
"bigquery",
"athena",
"redshift",
"duckdb",
"motherduck",
"postgres",
"mysql",
"sqlite",
"snowflake",
"salesforce",
"local_file",
"https",
];

const OLAP_CONNECTORS = ["clickhouse", "druid", "pinot"];

const SORT_ORDER = [...SOURCES, ...OLAP_CONNECTORS];

const ICONS = {
gcs: GoogleCloudStorage,
s3: AmazonS3,
Expand Down
22 changes: 22 additions & 0 deletions web-common/src/features/sources/modal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,25 @@ export const CONNECTION_TAB_OPTIONS: { value: string; label: string }[] = [
{ value: "parameters", label: "Enter parameters" },
{ value: "dsn", label: "Enter connection string" },
];

export const SOURCES = [
"gcs",
"s3",
"azure",
"bigquery",
"athena",
"redshift",
"duckdb",
"motherduck",
"postgres",
"mysql",
"sqlite",
"snowflake",
"salesforce",
"local_file",
"https",
];

export const OLAP_CONNECTORS = ["clickhouse", "druid", "pinot"];

export const SORT_ORDER = [...SOURCES, ...OLAP_CONNECTORS];
2 changes: 1 addition & 1 deletion web-common/src/features/sources/modal/submitAddDataForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { EntityType } from "../../entity-management/types";
import { EMPTY_PROJECT_TITLE } from "../../welcome/constants";
import { isProjectInitialized } from "../../welcome/is-project-initialized";
import { compileSourceYAML, maybeRewriteToDuckDb } from "../sourceUtils";
import { OLAP_CONNECTORS } from "./constants";

interface AddDataFormValues {
// name: string; // Commenting out until we add user-provided names for Connectors
Expand Down Expand Up @@ -174,7 +175,6 @@ export async function submitAddOLAPConnectorForm(

// Test the connection to the OLAP database (only for original OLAP connectors)
// If the connection test fails, rollback the changes
const OLAP_CONNECTORS = ["clickhouse", "druid", "pinot"];
if (OLAP_CONNECTORS.includes(connector.name as string)) {
const result = await testOLAPConnector(
instanceId,
Expand Down