DevEpos / abap-code-search-tools

ABAP Code Search
MIT License
22 stars 8 forks source link

Support for MSSQL Databases #14

Closed g-back closed 11 months ago

g-back commented 11 months ago

Hi Ludwig, in the newer releases, only HANA and Oracle are supported - I'm not too familiar with "ADBC" so my first question: is it technically possible to get support for MSSQL Databases?

If yes: could you provide a short guideline on what needs to be done to achieve that? Thanks!

stockbal commented 11 months ago

Hi @g-back,

it is certainly possible to also support MSSQL databases. As I only have access to ABAP Systems with HANA and Oracle DBMS connected, I did not want to implement and just blindly push it 😅.

The code that needs to be extended is not extensive:

1) enable dbms support check in the following method https://github.com/DevEpos/abap-code-search-tools/blob/21b580b4f6239bf2f20a21e38debf79164b49462/src/zcl_adcoset_db_support_util.clas.abap#L16-L18

2) create custom package reader implementation for MSSQL Here is the local class definition for HANA: https://github.com/DevEpos/abap-code-search-tools/blob/21b580b4f6239bf2f20a21e38debf79164b49462/src/zcl_adcoset_search_scope.clas.locals_def.abap#L207-L220 and the corresponding implementation: https://github.com/DevEpos/abap-code-search-tools/blob/21b580b4f6239bf2f20a21e38debf79164b49462/src/zcl_adcoset_search_scope.clas.locals_imp.abap#L36-L54

3) return instance of the MSSQL implementation in the factory method for a package reader https://github.com/DevEpos/abap-code-search-tools/blob/21b580b4f6239bf2f20a21e38debf79164b49462/src/zcl_adcoset_search_scope.clas.locals_imp.abap#L6-L15

I think that the implementation effort for MSSQL should be similar to Oracle and HANA. You have to check the native clauses for LIMIT and OFFSET in MSSQL and then adjust the implementation for MSSQL accordingly.

Regards, Ludwig

stockbal commented 11 months ago

Closed with #16