PHPackages                             tangwei/hyperf-oracle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. tangwei/hyperf-oracle

ActiveLibrary[Database &amp; ORM](/categories/database)

tangwei/hyperf-oracle
=====================

A oracle handler for hyperf/database.

v3.1.3(3mo ago)01.0k↓47%MITPHPPHP &gt;=8.1

Since Dec 24Pushed 3mo agoCompare

[ Source](https://github.com/tw2066/hyperf-oracle)[ Packagist](https://packagist.org/packages/tangwei/hyperf-oracle)[ RSS](/packages/tangwei-hyperf-oracle/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (18)Versions (11)Used By (0)

Oracle driver for Hyperf
========================

[](#oracle-driver-for-hyperf)

[![Latest Stable Version](https://camo.githubusercontent.com/36289167914f5b4f00cc319d4ca6f04bb8a804542c9df9ccddb183afc7509891/687474703a2f2f706f7365722e707567782e6f72672f74616e677765692f6879706572662d6f7261636c652f76)](https://packagist.org/packages/tangwei/hyperf-oracle) [![Total Downloads](https://camo.githubusercontent.com/8b65811ef81305a3378a64026bfc94756c7aeb6defff64e250f947d2b2620d6e/687474703a2f2f706f7365722e707567782e6f72672f74616e677765692f6879706572662d6f7261636c652f646f776e6c6f616473)](https://packagist.org/packages/tangwei/hyperf-oracle) [![Latest Unstable Version](https://camo.githubusercontent.com/796d09deecae44f51d05a0c7f5d68692ae727ed7c7b0299e0761322931d39861/687474703a2f2f706f7365722e707567782e6f72672f74616e677765692f6879706572662d6f7261636c652f762f756e737461626c65)](https://packagist.org/packages/tangwei/hyperf-oracle) [![License](https://camo.githubusercontent.com/f07bae5e139da620b3f2faabcf2b198e36ff104bbed72001f0df99c952bc30ec/687474703a2f2f706f7365722e707567782e6f72672f74616e677765692f6879706572662d6f7261636c652f6c6963656e7365)](https://packagist.org/packages/tangwei/hyperf-oracle) [![PHP Version Require](https://camo.githubusercontent.com/8032e4659cd894c58e6cfb9d3446570adecb735de8a60f2b9725f66c01a77962/687474703a2f2f706f7365722e707567782e6f72672f74616e677765692f6879706572662d6f7261636c652f726571756972652f706870)](https://packagist.org/packages/tangwei/hyperf-oracle)

Hyperf-Oracle
-------------

[](#hyperf-oracle)

Hyperf-Oracle is an Oracle Database Driver package for Hyperf. Extension of Hyperf\\Database that uses pdo-oci extension to communicate with Oracle. Through integration of Swoole, Hyperf optimizes resource utilization and boosts concurrency, leading to enhanced throughput and responsiveness when interfacing with Oracle databases.

Quick Installation
------------------

[](#quick-installation)

```
composer require tangwei/hyperf-oracle
```

Example
-------

[](#example)

```
use Hyperf\DbConnection\Db;

// select
Db::table('users')->get();
// insert
Db::table('users')->insert(['name' => 'jonas']);
// update
Db::table('users')->where('id', '=', 1)->update(['name' => 'johnny']);
// delete
Db::table('users')->delete(1);
```

Environment Settings
--------------------

[](#environment-settings)

The following environment variables should be configured to specify the connection details for the Oracle database:

```
DB_DRIVER=oracle
DB_HOST=oracle.host
DB_PORT=1521
DB_SERVICE_NAME=XE
DB_SID=XE
DB_USERNAME=user
DB_PASSWORD=password
DB_CHARSET=utf8mb4
DB_AUTO_COMMIT=false
DB_TIMEZONE=America/Sao_Paulo
```

Configuration in Code
---------------------

[](#configuration-in-code)

In your `databases.php` configuration file, you can set up the database connection using the following format:

```
return [
    'default' => [
        'driver' => env('DB_DRIVER', 'oracle'),
        'host' => env('DB_HOST', 'host'),
        'port' => env('DB_PORT', 1521),
        'database' => env('DB_DATABASE', 'hyperf'),
        'username' => env('DB_USERNAME', 'oracle'),
        'service_name' => env('DB_SERVICE_NAME', 'XE'),
        'sid' => env('DB_SID', 'XE'),
        'auto_commit' => env('DB_AUTO_COMMIT', false),
        'timezone' => env('DB_TIMEZONE', 'America/Sao_Paulo'),
        'password' => env('DB_PASSWORD', 'password'),
        'charset' => env('DB_CHARSET', 'AL32UTF8'),
        'prefix' => env('DB_PREFIX', ''),
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 10,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
        ],
        'commands' => [
            'gen:model' => [
                'path' => 'app/Model',
                'force_casts' => true,
                'inheritance' => 'Model',
                'uses' => '',
                'table_mapping' => [],
            ],
        ],
    ],
];
```

Credits
-------

[](#credits)

- [Jonas Elias](https://github.com/tangwei)
- [Arjay Angeles](https://github.com/yajra/laravel-oci8)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance79

Regular maintenance activity

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~20 days

Total

10

Last Release

111d ago

Major Versions

v0.1.0 → v2.2.02025-12-24

v2.2.0 → v3.1.02025-12-24

v2.2.2 → v3.1.22025-12-25

PHP version history (2 changes)v0.1.0PHP &gt;=8.0

v3.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24579418?v=4)[Mr.tang](/maintainers/tw2066)[@tw2066](https://github.com/tw2066)

---

Top Contributors

[![jonas-elias](https://avatars.githubusercontent.com/u/48037643?v=4)](https://github.com/jonas-elias "jonas-elias (57 commits)")[![tw2066](https://avatars.githubusercontent.com/u/24579418?v=4)](https://github.com/tw2066 "tw2066 (6 commits)")

---

Tags

phpdatabaseoracleoci8swoolehyperf

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/tangwei-hyperf-oracle/health.svg)

```
[![Health](https://phpackages.com/badges/tangwei-hyperf-oracle/health.svg)](https://phpackages.com/packages/tangwei-hyperf-oracle)
```

###  Alternatives

[hyperf/database-pgsql

A pgsql handler for hyperf/database.

12321.2k24](/packages/hyperf-database-pgsql)[hyperf/database

A flexible database library.

192.9M324](/packages/hyperf-database)[jonas-elias/hyperf-oracle

A oracle handler for hyperf/database.

102.5k](/packages/jonas-elias-hyperf-oracle)[hyperf/http-server

A HTTP Server for Hyperf.

103.0M373](/packages/hyperf-http-server)[hyperf/crontab

A crontab component for Hyperf.

131.7M77](/packages/hyperf-crontab)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
