redpanda-data / connect

Fancy stream processing made operationally mundane
https://docs.redpanda.com/redpanda-connect/about/
8.14k stars 840 forks source link

Add IBM DB2 Driver #2990

Open eucariop opened 2 weeks ago

eucariop commented 2 weeks ago

Hello

There is IBM DB2 driver for benthos seems the right tool for it.

I don't know what is the criteria for adding a new driver.

Cheers!

mihaitodor commented 2 weeks ago

Hey @eucariop 👋 It's on our radar, thanks for asking! Unfortunately, the official driver requires CGo, which means that it will have to be part of a separate build similar to the zmq4 components.

eucariop commented 2 weeks ago

Thanks @mihaitodor for the feedback, another factor to consider is CGO requires. If a CLI driver is already present on your system, it is advisable to set the following environment variables with the path of the CLI driver in a Docker environment. From my understanding, it is not currently feasible to inject a new driver into existing SQL components. However, I believe this could be beneficial in this case, as well as for DB2 and similar scenarios. My understanding is that the initial goal was to provide a mechanism that works on all platforms that support Go build to create their plugin and then have to determine the best method for installing the produced binary somewhere on their system (or in a Benthos or RedPanda Connect Docker container where RedPanda Connect can access it), it is unclear what the specific benefit of enabling this alternative plugin system over the existing one would be. Currently, Benthos can be imported as a library.

package main

import (
    _ "github.com/ibmdb/go_ibm_db"
    "database/sql"
    "fmt"
)
...
...

Reference Interface for GoLang to DB2 https://medium.com/@janeman98/quick-start-in-accessing-db2-for-z-os-from-go-application-d4561f53e91b https://zhimin-wen.medium.com/talking-to-ibm-db2-with-golang-dad8bb6ee4b4