Welcome Guest, Not a member yet? Register   Sign In
ODBC or DB2 Support - Code Essentially Complete
#1

Hi there,

I am looking to use CodeIgniter natively on an iSeries/DB2 environment given the development, maintainability and deployment simplicity. I am aware that ODBC/DB2 is not currently supported starting with CI4 (https://codeigniter4.github.io/CodeIgnit...ments.html). With that said, I was able to locate someone else's work (rsgarcia0203) on GitHub that provides an ODBC abilities in CI4 (https://github.com/rsgarcia0203/ODBC_CodeIgniter4). To make it work on DB2 drivers, I only had to reformat two lines for the referenced driver and pconnect/connect lines to be the DB2 "IBM i Access ODBC Driver" and some ordering syntax of the call of the username/password.

With that said......is there any possibility that this ODBC code at least (or the DB2 flair version) be added to the official release, since the coding is already essentially completed?  I know I have seen the question many times on the forums about ODBC option (and DB2 functionality) and this would provide an official solve in restoring abilities lost in the transition from CI3 to CI4.

Thanks for the consideration!


-----DB2 Code Variation from pull-----
/**
    * Connect to the database.
    *
    * @param bool $persistent
    *
    * @return bool|resource
    * @throws DatabaseException
    *
    */
    public function connect(bool $persistent = false)
    {
        return ($persistent === TRUE)
            ? odbc_pconnect("Driver={IBM i Access ODBC Driver}; System=". $this->DSN ."; Database=". $this->database .";", $this->username, $this->password)
            : odbc_connect("Driver={IBM i Access ODBC Driver}; System=". $this->DSN ."; Database=". $this->database .";", $this->username, $this->password);
    }
Reply




Theme © iAndrew 2016 - Forum software by © MyBB