sql-to-jdl icon indicating copy to clipboard operation
sql-to-jdl copied to clipboard

Add support for Oracle

Open octgsoftware opened this issue 2 years ago • 1 comments

This should only require writing proper native SQL files for 3 queries and a SqlJdlTypeService.

octgsoftware avatar Nov 29 '22 23:11 octgsoftware

Re-opening this ticket, I think there is still work to be done. See comment of first PR https://github.com/Blackdread/sql-to-jdl/pull/177#discussion_r1118048107

I think, some steps needed:

  • remove logic if (value.equals("NUMBER(38)") || value.equals("NUMBER(19,5)")) from public static String parseSqlType(String value) of SqlUtils -> Define overridden method in OracleJdlTypeService for default JdlFieldEnum sqlTypeToJdlType(final String sqlType) -> so we can handle oracle specific types and parsing differentely
  • handle more types
  • allow definition of short, int, long
  • better handling of decimal(p, s) -> NUMBER [ (p [, s]) ]

Docs:

  • https://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF30020
  • https://www.oracletutorial.com/oracle-basics/oracle-data-types/
  • https://www.w3resource.com/oracle/oracle-data-types.php

Blackdread avatar Feb 26 '23 16:02 Blackdread