Giter VIP home page Giter VIP logo

db's People

Contributors

mychidarko avatar netinhoteixeira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

db's Issues

Problem in SSL connection through PDO

I tried connecting my local codebase with the remote database through PDO but its not working, after that I made some changes in core.php and created a function using mysqli, and now the connection is working.

I used the same connection variables and pem files for verification

inside connect function in core.php

I also tried directly writing the PDO code as follows:

           $clientCertPath = $_SERVER['DOCUMENT_ROOT'] . "/client-cert.pem";
            $clientKeyPath = $_SERVER['DOCUMENT_ROOT'] . "/client-key.pem";
            $caCertPath = $_SERVER['DOCUMENT_ROOT'] . "/server-ca.pem";

            // PDO Connection options for SSL
            $pdoOptions = array(
                \PDO::MYSQL_ATTR_SSL_CA => $caCertPath,
                \PDO::MYSQL_ATTR_SSL_KEY => $clientKeyPath,
                \PDO::MYSQL_ATTR_SSL_CERT => $clientCertPath,
                \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
            );

Break up leaf db

Leaf DB is now the longest class with 800+ lines of code. It needs to be managed to improve performance and generally make the code easier to follow

Connecting sql server

Could not connect to sql server , I had to modify this function and add 'sqlsrv' to make it work

protected function dsn(): string
{
$dbtype = $this->config('dbtype');
$dbname = $this->config('dbname');
$host = $this->config('host');

    if ($dbtype === 'sqlite') {
        $dsn = "sqlite:$dbname";
    }
    else if ($dbtype === 'sqlsrv') {
        $dsn =  $dbtype.":Server=".$this->config('host');
        $dsn .= ";Database=".$this->config('database');    
    } else {
        $dsn = "$dbtype:host=$host";
        if ($dbname !== '') $dsn .= ";dbname=$dbname";
        if ($this->config('port')) $dsn .= ';port=' . $this->config('port');
        if ($this->config('charset')) $dsn .= ';charset=' . $this->config('charset');
        if ($this->config('unixSocket')) $dsn .= ';unix_socket=' . $this->config('unixSocket');
    }

    return $dsn;
}

lastInsertId not working with uuid

The function db()->lastInsertId does not work with with uuid. It works fine with incremental ids

Steps to reproduce

  • Use db()->insert(...)->params([...])->execute()
  • Run db()->lastInsertId()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.