定制 nadyita/reactdb 二次开发

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

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

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固