All Projects → swoole → ext-postgresql

swoole / ext-postgresql

Licence: other
🐘 Coroutine-based client for PostgreSQL

Programming Languages

C++
36643 projects - #6 most used programming language
M4
1887 projects
PHP
23972 projects - #3 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ext-postgresql

Swoft Framework
[READ ONLY] Swoft Framework, base of Swoft
Stars: ✭ 70 (+12.9%)
Mutual labels:  swoole, coroutine
Mix
☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、WorkerMan、FPM、CLI-Server
Stars: ✭ 1,753 (+2727.42%)
Mutual labels:  swoole, coroutine
Php Coroutine Engine
This project for php-fpm support coroutine
Stars: ✭ 74 (+19.35%)
Mutual labels:  swoole, coroutine
Swoft Db
[READ ONLY] Database Compoment for Swoft
Stars: ✭ 25 (-59.68%)
Mutual labels:  swoole, coroutine
Guzzle Swoole
让基于 Guzzle 的项目完美无缝兼容 Swoole 协程,支持:Guzzle、Elasticsearch client——来自宇润 PHP 全家桶
Stars: ✭ 143 (+130.65%)
Mutual labels:  swoole, coroutine
Saber
⚔️ Saber, PHP异步协程HTTP客户端 | PHP Coroutine HTTP client - Swoole Humanization Library
Stars: ✭ 866 (+1296.77%)
Mutual labels:  swoole, coroutine
Yii2 Swoole
full solutions making yii2-framework run on swoole with coroutine.
Stars: ✭ 86 (+38.71%)
Mutual labels:  swoole, coroutine
Easyswoole
swoole,easyswoole,swoole framework
Stars: ✭ 4,409 (+7011.29%)
Mutual labels:  swoole, coroutine
Aint Queue
🚀 An async-queue library built on top of swoole, flexable multi-consumer, coroutine supported. 基于 Swoole 的一个异步队列库,可弹性伸缩的工作进程池,工作进程协程支持。
Stars: ✭ 143 (+130.65%)
Mutual labels:  swoole, coroutine
Swoole Docker
See: https://github.com/swoole/docker-swoole
Stars: ✭ 132 (+112.9%)
Mutual labels:  swoole, coroutine
Paysdk
PHP 集成支付 SDK ,集成了支付宝、微信支付的支付接口和其它相关接口的操作。支持 php-fpm 和 Swoole,所有框架通用。宇润PHP全家桶技术支持群:17916227
Stars: ✭ 723 (+1066.13%)
Mutual labels:  swoole, coroutine
Hyperf Skeleton
🛠 A skeleton of Hyperf framework that provided by official team
Stars: ✭ 162 (+161.29%)
Mutual labels:  swoole, coroutine
Imi
imi 是基于 Swoole 的 PHP 协程开发框架,它支持 Http、Http2、WebSocket、TCP、UDP、MQTT 等主流协议的服务开发,特别适合互联网微服务、即时通讯聊天im、物联网等场景!。QQ群:17916227
Stars: ✭ 680 (+996.77%)
Mutual labels:  swoole, coroutine
Swpdo
Swoole Coroutine SQL component like PDO | 0成本迁移PDO到Swoole高性能协程客户端
Stars: ✭ 64 (+3.23%)
Mutual labels:  swoole, coroutine
Swoft
🚀 PHP Microservice Full Coroutine Framework
Stars: ✭ 5,420 (+8641.94%)
Mutual labels:  swoole, coroutine
Ycsocket
基于swoole的socket框架,支持协程版MySQL、Redis连接池,已用于大型RPG游戏服务端
Stars: ✭ 77 (+24.19%)
Mutual labels:  swoole, coroutine
Yurunoauthlogin
PHP 第三方登录授权 SDK,集成了QQ、微信、微博、Github等常用接口。支持 php-fpm 和 Swoole,所有框架通用。QQ群:17916227
Stars: ✭ 330 (+432.26%)
Mutual labels:  swoole, coroutine
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+6683.87%)
Mutual labels:  swoole, coroutine
Archer
基于协程Swoole的Task组件,支持多种模式。轻松实现协程Task的队列、并发、Defer、计时器等 | Swoole coroutine task kit - Swoole Humanization Library
Stars: ✭ 132 (+112.9%)
Mutual labels:  swoole, coroutine
Yii2 Swoole
make yii2 project runing on swoole
Stars: ✭ 161 (+159.68%)
Mutual labels:  swoole, coroutine

Swoole Coroutine Postgres Client

ext-postgresql is the Swoole Postgres Client library can be used with in the coroutine context without blocking.

Pre-requirement

  • libpq is required
  • swoole version >= 4.4.0

Build & Installation

git clone [email protected]:swoole/ext-postgresql.git
phpize
./configure
make && make install

Enable swoole_postgresql in php.ini by adding the following line:

extension=swoole_postgresql.so

How to use the Postgres Client

<?php
Co\run(function () {
    $db = new Swoole\Coroutine\PostgreSQL();
    $db->connect("host=127.0.0.1 port=5432 dbname=test user=root password=password");
    $db->prepare('fortunes', 'SELECT id, message FROM Fortune');
    $res = $db->execute('fortunes', []);
    $arr = $db->fetchAll($res);
    var_dump($arr);

    $db->prepare('select_query', 'SELECT id, randomnumber FROM World WHERE id = $1');
    $res = $db->execute('select_query', [123]);
    $ret = $db->fetchAll($res);
    var_dump($ret);
});

You can find more examples in the /examples folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].