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

Mysql Support #66

Open
mohaalak opened this issue Nov 30, 2021 · 5 comments
Open

Mysql Support #66

mohaalak opened this issue Nov 30, 2021 · 5 comments
Labels
backend-integration Interop code between DSL and some db backend, e.g. generate SQL, execute, [de]serialize results

Comments

@mohaalak
Copy link

is there any plan for supporting MySQL?
I read your thesis paper and read most of the source code, I think it should not be hard to add MySQL too.
I'm up for the task if you have any concern let me know.

@Kamirus
Copy link
Owner

Kamirus commented Nov 30, 2021

I think adding MySQL should be possible, hopefully without changing the general backend-agnostic part of the code.
Ideally MySQL and other backends should be separate purescript packages e.g. purescript-selda-mysql, would you mind implementing it that way?

@paluh do you have some comments on that?

@Kamirus Kamirus added the backend-integration Interop code between DSL and some db backend, e.g. generate SQL, execute, [de]serialize results label Nov 30, 2021
@mohaalak
Copy link
Author

mohaalak commented Dec 1, 2021

the main problem for a separate purescript package is how should I add litMysql for example, in instance chaining.

@Kamirus
Copy link
Owner

Kamirus commented Dec 1, 2021

Lit typeclass is pure optional convenience - just provide litMySQL similar to litPG and ignore adding it to Lit.

The problem with this extensibility just proves that current solution is not ideal, because lit handles both backend-agnostic literals like String, Int, but also backend-specific ones which requires the instance chain.

Anyway, there are solutions to this problem, like splitting Lit into two separate type classes, but we would need more time to discuss these design changes.

@mohaalak
Copy link
Author

I'm in the middle of supporting MySql for selda right now the issue that when creating query the column names are surrounded with " and MySql cannot parse this columns if I remove the " from this function

showColumnName name = "\"" <> name <> "\""

everything works

@Kamirus
Copy link
Owner

Kamirus commented Dec 30, 2021

Would setting ANSI_QUOTES resolve this problem without changing showColumnName?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-integration Interop code between DSL and some db backend, e.g. generate SQL, execute, [de]serialize results
Projects
None yet
Development

No branches or pull requests

2 participants