2017 © Pedro Peláez
 

library mysqlite

Select MySQL compatibility functions for PDO's SQLite driver

image

vectorface/mysqlite

Select MySQL compatibility functions for PDO's SQLite driver

  • Thursday, February 9, 2017
  • by janderson
  • Repository
  • 9 Watchers
  • 20 Stars
  • 4,005 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 8 Versions
  • 6 % Grown

The README.md

MySQLite

Build Status Code Coverage, (*1)

MySQLite is an easy way to add MySQL functions to SQLite accessed through PDO. This can be useful for testing and development where an SQLite database may be more practical than a real MySQL database., (*2)

Usage

Using MySQLite is meant to be a one-step affair, with no configuration required:, (*3)

use Vectorface\MySQLite\MySQLite;

// Create a PDO instance on an SQLite database
$pdo = new PDO('sqlite::memory:');

// Create compatibility functions for use within that database connection.
MySQLite::createFunctions($pdo);

// Use it.
$three = $pdo->query("SELECT BIT_OR(1, 2)")->fetch(PDO::FETCH_COLUMN);
// Wait... That works now?!? What the what?!?

It is also possible to use it as a one-liner:, (*4)

$pdo = MySQLite::createFunctions(new PDO('sqlite::memory:'));

You can get a list of supported functions with MySQLite::getFunctionList()., (*5)

Limitations

MySQLite only provides a limited subset of MySQL functions. There are a lot of MySQL functions, so there's both a developer cost and performance penalty to adding them all., (*6)

If you want to add more, it's easy. You only need to add a function called mysql_[function name] into one of the traits in src/Vectorface/MySQLite/MySQL., (*7)

For example, to create a function FOO() with silly behavior in String.php:, (*8)

    ...
    public static function mysql_foo($foo)
    {
        if ($foo == "foo") {
            return "bar";
        }
        return $foo;
    }
    ...

With the above definition present, String::mysql_foo will automatically be registered with MySQLite::createFunctions($pdo) is used., (*9)

The Versions

09/02 2017

dev-dev

dev-dev https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

09/02 2017

dev-master

9999999-dev https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

09/02 2017

v0.1.4

0.1.4.0 https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

17/10 2016

v0.1.3

0.1.3.0 https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

17/10 2016

dev-string_rename

dev-string_rename https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

23/06 2015

v0.1.2

0.1.2.0 https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

04/06 2015

v0.1.1

0.1.1.0 https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility

14/10 2014

v0.1.0

0.1.0.0 https://github.com/Vectorface/MySQLite

Select MySQL compatibility functions for PDO's SQLite driver

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

debug testing mysql sqlite compatibility