Skip to content

Commit

Permalink
Merge pull request #230 from RamiAwar/S14.Z-mysql-connection-support
Browse files Browse the repository at this point in the history
Add mysql python connector used by sqlalchemy
  • Loading branch information
RamiAwar authored Jun 30, 2024
2 parents 9dc0fe9 + 4724c65 commit 5b30a37
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 2 additions & 0 deletions backend/dataline/models/connection/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def validate_dsn(value: str) -> str:
if value.startswith("postgres") and not value.startswith("postgresql"):
# Only replace first occurrence
value = value.replace("postgres", "postgresql", 1)
elif value.startswith("mysql"):
value = value.replace("mysql", "mysql+pymysql", 1)

return value

Expand Down
14 changes: 0 additions & 14 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added frontend/src/assets/images/mysql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion frontend/src/components/Connection/DatabaseDialectImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import postgresImage from "../../assets/images/postgres.png";
import sqliteImage from "../../assets/images/sqlite.png";
import snowflakeImage from "../../assets/images/snowflake.png";
import mysqlImage from "../../assets/images/mysql.png";
import { CircleStackIcon } from "@heroicons/react/24/outline";

interface DatabaseDialectImageProps {
Expand All @@ -15,13 +16,14 @@ const DatabaseDialectImage: React.FC<DatabaseDialectImageProps> = ({
postgresql: postgresImage,
sqlite: sqliteImage,
snowflake: snowflakeImage,
mysql: mysqlImage,
// You can add more mappings here as needed
};

const imageSrc = imageMap[databaseDialect];

if (!imageSrc) {
return <CircleStackIcon className="text-gray-400" />;
return <CircleStackIcon className="text-gray-400 h-full" />;
}

return <img className="h-full" src={imageSrc} alt={databaseDialect} />;
Expand Down

0 comments on commit 5b30a37

Please sign in to comment.