-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add MySQL datasource #1313
Conversation
Your Render PR Server URL is https://toolpad-pr-1313.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cdlldqien0hskv3hfsn0. |
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 |
import { errorFrom } from '../../utils/errors'; | ||
import { Maybe } from '../../utils/types'; | ||
import { SqlConnectionParams, SqlExecBase, SqlPrivateQuery, SqlQuery, SqlResult } from './types'; | ||
|
There was a problem hiding this comment.
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<...> {
// ...
}
There was a problem hiding this comment.
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
Should we also update the docs about MySQL? |
Yes
You could check and update that issue with the status |
Awesome 👌 |
MySQL_conn.mov