crystal-libraries-needed icon indicating copy to clipboard operation
crystal-libraries-needed copied to clipboard

MaxDB (the DBMS of SAP) support

Open alexanderadam opened this issue 7 years ago • 6 comments

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.

alexanderadam avatar Dec 31 '18 15:12 alexanderadam

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.

RX14 avatar Jan 02 '19 12:01 RX14

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?

alexanderadam avatar Jan 03 '19 09:01 alexanderadam

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

RX14 avatar Jan 03 '19 12:01 RX14

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.

alexanderadam avatar Jan 03 '19 14:01 alexanderadam

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

konovod avatar Jan 04 '19 18:01 konovod

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

Seems also to be available on GitHub.

alexanderadam avatar Jan 04 '19 19:01 alexanderadam