nadyita/reactdb
Composer 安装命令:
composer require nadyita/reactdb
包简介
A wrapper around MySQL and SQLite to have common interfaces
关键字:
README 文档
README
A wrapper around ReactPHP's MySQL and SQLite implementations that wraps them in a unified interface, so that you don't have to worry about which database implementation you are actually talking to.
Quickstart example
Here is an SQLite database connection using this interface
$loop = React\EventLoop\Factory::create(); $factory = new Clue\React\SQLite\Factory($loop); $db = new Nadyita\ReactDB\SQLite($factory->openLazy('test.db')); $db->exec('CREATE TABLE IF NOT EXISTS foo (id INTEGER PRIMARY KEY AUTOINCREMENT, bar STRING)'); $name = 'Alice'; $db->query('INSERT INTO foo (bar) VALUES (?)', [$name])->then( function (Nadyita\ReactDB\Result $result) use ($name) { echo 'New ID for ' . $name . ': ' . $result->getinsertID() . PHP_EOL; } ); $db->quit(); $loop->run();
Install
The recommended way to install this library is through Composer. New to Composer?
This project follows SemVer. This will install the latest supported version:
$ composer require nadyita/reactdb:^1.0
See also the CHANGELOG for details about version upgrades.
This project aims to run on any platform and thus does not require any PHP extensions and supports running on PHP 7.3+.
Tests
To run the test suite, you first need to clone this repo and then install all dependencies through Composer:
$ composer install
To run the test suite, go to the project root and run:
$ composer test
License
MIT, see LICENSE file.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-05