Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5666
Closed
Open
Issue created Mar 22, 2020 by Administrator@rootContributor

[REQ] SQL queries generation

Created by: ybelenko

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

Assignee
Assign to
Time tracking