PHPackages                             tina4stack/tina4php-database - 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. tina4stack/tina4php-database

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

tina4stack/tina4php-database
============================

Tina4 PHP Database Module

v2.0.24(2mo ago)37.5k↓18.2%214MITPHPPHP &gt;=8.1CI passing

Since Oct 20Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/tina4stack/tina4php-database)[ Packagist](https://packagist.org/packages/tina4stack/tina4php-database)[ RSS](/packages/tina4stack-tina4php-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (36)Used By (14)

tina4php-database
=================

[](#tina4php-database)

Core database abstraction module for the Tina4 PHP framework, providing the `DataBase` interface, `DataBaseCore` trait, `DataResult`, `DataRecord`, `DataError`, and the `NoSQLParser` for MongoDB support.

Installation
------------

[](#installation)

```
composer require tina4stack/tina4php-database
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- ext-json
- tina4stack/tina4php-debug ^2.0

Usage
-----

[](#usage)

### Implementing a Custom Database Driver

[](#implementing-a-custom-database-driver)

```
use Tina4\DataBase;
use Tina4\DataBaseCore;

class DataMyDb implements DataBase
{
    use DataBaseCore;

    public function open() { /* open connection */ }
    public function close() { /* close connection */ }
    public function exec() { /* execute statement */ }
    // ... implement remaining interface methods
}
```

### Running a Query

[](#running-a-query)

```
$db = new DataMyDb("localhost/3306:mydb", "user", "password");
$result = $db->fetch("SELECT * FROM users WHERE active = 1");

foreach ($result->records() as $record) {
    echo $record->name;
}
```

### Using the NoSQL Parser

[](#using-the-nosql-parser)

```
use Tina4\NoSQLParser;

$parser = new NoSQLParser();
$parsed = $parser->parseSQLToNoSQL("select id, name from users where id = 1");
// Returns: ["collectionName" => "users", "columns" => ["id", "name"], "filter" => ["id" => ['$eq' => '1']]]
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT - see [LICENSE](LICENSE)

---

Our Sponsors
------------

[](#our-sponsors)

**Sponsored with 🩵 by Code Infinity**

[![Code Infinity](https://camo.githubusercontent.com/1516fb1662e3486bce77822177a5ea199edc32ea109369812592ec9bca38159a/68747470733a2f2f636f6465696e66696e6974792e636f2e7a612f77702d636f6e74656e742f75706c6f6164732f323032352f30392f6338652d6c6f676f2d6769746875622e706e67)](https://codeinfinity.co.za/about-open-source-policy?utm_source=github&utm_medium=website&utm_campaign=opensource_campaign&utm_id=opensource)

*Supporting open source communities • Innovate • Code • Empower*

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~47 days

Recently: every ~52 days

Total

35

Last Release

65d ago

Major Versions

v1.0.10 → v2.0.02022-02-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82961293?v=4)[Tina4](/maintainers/tina4stack)[@tina4stack](https://github.com/tina4stack)

---

Top Contributors

[![andrevanzuydam](https://avatars.githubusercontent.com/u/6102941?v=4)](https://github.com/andrevanzuydam "andrevanzuydam (53 commits)")[![justin-k-bruce](https://avatars.githubusercontent.com/u/22364123?v=4)](https://github.com/justin-k-bruce "justin-k-bruce (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tina4stack-tina4php-database/health.svg)

```
[![Health](https://phpackages.com/badges/tina4stack-tina4php-database/health.svg)](https://phpackages.com/packages/tina4stack-tina4php-database)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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