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
  • #3503
Closed
Open
Issue created Jul 31, 2019 by Administrator@rootContributor

[REQ][MySQL] snake_case table and column names

Created by: ybelenko

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

Current MySQL schema generator is far from perfect. I think that output of this generator should look exactly like mysqldump utility output or PHPMyAdmin SQL export. mysqldump and PHPMyAdmin are both stable and well-tested solutions, so same output would be a great achievement.

This particular issue is not about syntax, but SQL coding style. snake_case variables are what db developers used to see.

Describe the solution you'd like

Let's convert all table/column names to snake_case. Original variable name can be mentioned in table/column comment.

CREATE TABLE IF NOT EXISTS `file` (
  `source_uri` TEXT DEFAULT NULL COMMENT 'Original param name \'sourceURI\' '
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Original model name \'File\'';

Should we add generator option to disable this enhancement? Where in codegen we should store snake_case name?

Additional context

I'm working on it, just want to track progress. Any suggestions or tips are welcome.

Assignee
Assign to
Time tracking