crystal-community / crystal-libraries-needed

A list of libraries that are needed or wanted for the Crystal-Language
141 stars 4 forks source link

MaxDB (the DBMS of SAP) support #100

Open alexanderadam opened 5 years ago

alexanderadam commented 5 years ago

I'm not sure whether it should be here or as an issue on the crystal-db project but it would be nice to be able to connect to MaxDB. The Ruby gem is using the JDBC driver for that.

RX14 commented 5 years ago

That ruby gem only works on jruby by loading java code. If nobody has managed to port it to ruby, let alone crystal, I doubt this will happen any time soon.

alexanderadam commented 5 years ago

Yes, the gem was written by SAP so I guess they wanted to provide compatibility to their database without investing too much resources into Ruby. On the other hand there's even a driver for PHP that is mostly written in C (see php_maxdb.c and php_maxdb.h). And because Crystal and C are very good friends I wont loose any hope. :wink:

But @RX14, independent from that, do you think the place for this issue here is fine or should I rather move this to the crystal-db project? I guess it should be fine here because #70 is here as well?

RX14 commented 5 years ago

It belongs here. If there's a C driver, then that's good! It can probably be bound.

alexanderadam commented 5 years ago

For anyone who wants to have a look at it: Here is the PHP C driver (just in case anything happens with the linked svn repository).

php_maxdb.c.txt php_maxdb.h.txt

There are some calls that create PHP functions (i.e. PHP_FUNCTION, PHP_FALIAS, ZEND_DECLARE_MODULE_GLOBALS and zend_function_entry) and I guess those have to be rewritten / removed / replaced by Crystal defintions.

konovod commented 5 years ago

PHP driver is basically a wrapper around a C SDK: http://maxdb.sap.com/documentation/sqldbc/SQLDBC_API and there is even an .h file available without registration - http://maxdb.sap.com/documentation/sqldbc/SQLDBC_API/SQLDBC__C_8h-source.html

alexanderadam commented 5 years ago

@konovod you are clearly better in googling than me :wink: :+1:

Seems also to be available on GitHub.