Blackdread / sql-to-jdl

Tool to translate SQL databases to JDL format of jHipster (Created due to existing databases to be generated with jHipster and build angular-java web)
MIT License
183 stars 82 forks source link

Convert MySQL cod to use SQL instead of jOOQ #135

Closed octgsoftware closed 1 year ago

octgsoftware commented 1 year ago

I don't think this will take much time at all given jOOQ already prints outs out the SQL in the logs. Do you want me to convert the MySqlInformationSchemaRepository?

Also, I would probably convert MySqlJdlTypeService to the way I implemented PostgresJdlTypeService. My technique removes the need for duplicate values because the map will not allow duplicate keys. There is also no need for isTypeContained because this just becomes a simple map lookup.

Also, I write out UNSUPPORTED for an unknown type rather than throwing and error. I could add a application.yml property to control if an error is thrown or UNSUPPORTED is written as the type. A third option to just skip the column also seems like a reasonable idea.

Thoughts?

Blackdread commented 1 year ago

I like jOOQ but as we are using testcontainers for each individual DB type then it is fine to just use pure SQL, not many queries either.

Makes sense to convert MySqlJdlTypeService to similar as PostgresJdlTypeService.

Yes for UNSUPPORTED, yes for option to decide to throw or write UNSUPPORTED, does not hurt to have a third option to skip the column