Skip to content

SQL files generation #860

@jdiazgon

Description

@jdiazgon

Expected behavior

As a developer and user of CobiGen, I want CobiGen to generate database schema (SQL) from entities or OpenAPI so that I can save time.

Description

I think it would be very easy to create some templates in order to generate database schema. For instance, having the following entity:

public class EmployeeEntity {

	@Column(name = "EMPLOYEEID")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long employeeId;

	@Column(name = "NAME")
	private String name;

	@Column(name = "SURNAME")
	private String surname;

	@Column(name = "EMAIL")
	private String email;
}

It could generate the following SQL file:

CREATE TABLE EMPLOYEE ( 
id BIGINT auto_increment, modificationCounter INTEGER NOT NULL, 
employeeid BIGINT auto_increment, 
name VARCHAR(255), 
surname VARCHAR(255), 
email VARCHAR(255), 
PRIMARY KEY (employeeid) 
); 

This is a feature that has been requested by multiple developers.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions