golang package for GT.M database

775 views Asked by At

Is there any golang package already available to access GT.M database?

For example there is a package named mgo which is used to handle mongoDb in go language. Similarly couchgomaster package is used to access couchDb in go language.

I need to access GT.M database through go language.

3

There are 3 answers

0
VonC On BEST ANSWER

No: the Greystone Technology M doesn't seem to have any public go project.

The go-search queries (for gtm or for greystone) don't return anything relevant.

0
K.S. Bhaskar On

There is not an existing binding between FIS GT.M (http://fis-gtm.com) and Go that I know of.

However, interfacing GT.M to any other language that can make C compatible calls is straightforward. Since I don't know Go, I'll answer in terms of C and you can adjust accordingly. To call from C to GT.M, create your preferred API in GT.M, create a file with the call-in table (a text file mapping C function names to GT.M function names). To call from GT.M to C, create C functions to call & compile them into a shared library, and create the call-out table. The GT.M Programmers Guide UNIX Edition Chapter 11 (Integrating External Routines) has examples you can download. [For all GT.M user documentation, go to the GT.M home page and click on the User Documentation tab.]

If you're more comfortable with Java than with C, you can use GTMJI (go to http://sourceforge.net/projects/fis-gtm/files/Plugins/GTMJI/ and get the latest version), which provides call-ins between GT.M and Java. Documentation for GTMJI is on the GT.M user documentation page.

While GTMJI is developed by the GT.M development team, there are third party bindings that you can use / model, including node.js, Python (see OSEHRA and PyPI), Ruby, and Perl. While I know GT.M and GTMJI personally (I am part of the GT.M team), I know less about the third party bindings, although I do know that the node.js binding is in daily production use.

If you have further questions, please do ask.

0
AudioBubble On

Here is more info on interfacing natively with Go to C.

http://www.goinggo.net/2013/08/using-c-dynamic-libraries-in-go-programs.html

I believe you can write a little c program with required functions: gtm_init(), gtm_set(), gtm_get(), gtm_del() etc. and then interface with CGO