Skip to content
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

Add MySQL datasource #1313

Merged
merged 42 commits into from
Jan 27, 2023
Merged

Add MySQL datasource #1313

merged 42 commits into from
Jan 27, 2023

Conversation

bharatkashyap
Copy link
Member

MySQL_conn.mov

@bharatkashyap bharatkashyap added the feature: Connections PostgreSQL, MySQL, etc. label Nov 9, 2022
@render
Copy link

render bot commented Nov 9, 2022

@Janpot
Copy link
Member

Janpot commented Nov 9, 2022

Most SQL datasources will have a large overlapping feature set. I was hoping we could reuse as much code as possible for all of them. I was thinking, instead of copy+pasting the PG datasource, we should reuse as much code as possible. Would it be possible to create a "datasource factory" that we could use to create both the pg and mysql variant with. That way bugfixes and new features to one will also make it to the other. (e.g. we add UI to show available tables)

@bharatkashyap
Copy link
Member Author

Most SQL datasources will have a large overlapping feature set. I was hoping we could reuse as much code as possible for all of them. I was thinking, instead of copy+pasting the PG datasource, we should reuse as much code as possible. Would it be possible to create a "datasource factory" that we could use to create both the pg and mysql variant with. That way bugfixes and new features to one will also make it to the other. (e.g. we add UI to show available tables)

Agreed, I tweaked the implementation to follow this

@bharatkashyap bharatkashyap changed the title Feat: Add MySQL datasource Add MySQL datasource Nov 11, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 15, 2022
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Nov 15, 2022
import { errorFrom } from '../../utils/errors';
import { Maybe } from '../../utils/types';
import { SqlConnectionParams, SqlExecBase, SqlPrivateQuery, SqlQuery, SqlResult } from './types';

Copy link
Member

Choose a reason for hiding this comment

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

I was wondering whether it would make sense to abstract the whole datasource?

export function createSqlServerDatasource<...>({ execSql, tablesQuery }): ServerDatasource<...> {
  // ...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. I've pushed a change that does this

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 22, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 28, 2022
@oliviertassinari oliviertassinari requested a deployment to mysql-datasource - toolpad-db PR #1313 November 30, 2022 07:04 — with Render Abandoned
@oliviertassinari oliviertassinari temporarily deployed to mysql-datasource - toolpad PR #1313 January 3, 2023 09:52 — with Render Destroyed
@bharatkashyap bharatkashyap requested review from a team and removed request for Janpot January 3, 2023 10:38
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 13, 2023
@oliviertassinari oliviertassinari requested a deployment to mysql-datasource - toolpad-db PR #1313 January 23, 2023 12:46 — with Render Abandoned
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 23, 2023
@oliviertassinari oliviertassinari temporarily deployed to mysql-datasource - toolpad PR #1313 January 23, 2023 12:47 — with Render Destroyed
@oliviertassinari oliviertassinari temporarily deployed to mysql-datasource - toolpad PR #1313 January 25, 2023 12:13 — with Render Destroyed
@oliviertassinari oliviertassinari temporarily deployed to mysql-datasource - toolpad PR #1313 January 25, 2023 12:14 — with Render Destroyed
@bharatkashyap bharatkashyap merged commit 11b6952 into master Jan 27, 2023
@bharatkashyap bharatkashyap deleted the mysql-datasource branch January 27, 2023 09:04
@prakhargupta1
Copy link
Member

Should we also update the docs about MySQL?
The preview that comes after Insert, Delete has it also started coming for PostgreSQL? #1586

@bharatkashyap
Copy link
Member Author

Should we also update the docs about MySQL?

Yes

The preview that comes after Insert, Delete has it also started coming for PostgreSQL? #1586

You could check and update that issue with the status

@oliviertassinari
Copy link
Member

Awesome 👌

@oliviertassinari oliviertassinari added the new feature New feature or request label Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Connections PostgreSQL, MySQL, etc. new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MySQL data source
4 participants