定制 vectorface/mysqlite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vectorface/mysqlite

最新稳定版本:v0.2.1

Composer 安装命令:

composer require --dev vectorface/mysqlite

包简介

Select MySQL compatibility functions for PDO's SQLite driver

README 文档

README

Build Status Code Coverage

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.

Usage

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

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:

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

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

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.

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.

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

 ... 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.

统计信息

  • 总下载量: 38.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 36
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 36
  • Watchers: 12
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固