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

[REQ] SQL queries generation #5666

Closed
ybelenko opened this issue Mar 22, 2020 · 1 comment · Fixed by #5757
Closed

[REQ] SQL queries generation #5666

ybelenko opened this issue Mar 22, 2020 · 1 comment · Fixed by #5757

Comments

@ybelenko
Copy link
Contributor

ybelenko commented Mar 22, 2020

Is your feature request related to a problem? Please describe.

Right now we have several PHP server generators and MySQL schema generator. In most cases user will have to write basic SQL queries like

SELECT * FROM `pets` WHERE `id` = :id LIMIT 1

We can produce these queries. If they'll be not 100% accurate it's easier to edit few variables than write the whole query over and over again. The only question is where we should add them? To MySQL generator or to PHP generator? Or we need to create mix of 2 generators?

Describe the solution you'd like

Add folder to MySQL generator called php/pdo and put PHP helper functions for pdo database controller. I think each model requires at least 4 functions: insert, select, update, delete.

Describe alternatives you've considered

It's possible to add storageEngine: mysqlPdo option to PHP server generator, but MySQL schema generator produces table and column names differently, so it can cause column name mismatch errors and broken SQL queries as result.

cc @jebentier, @dkarlovi, @mandrean, @jfastnacht, @ackintosh, @renepardon

@ybelenko
Copy link
Contributor Author

As soon as it's related to all server generators @jimschubert please give us your opinion too. How would you generate SQL queries for C#/Kotlin/Scala server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant