PHPackages                             dcmunhoz/data-access - 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. dcmunhoz/data-access

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

dcmunhoz/data-access
====================

Data Access is a library designed to manipulate databases

1.0.3(6y ago)07MITPHPPHP ^7.0

Since Oct 22Pushed 6y agoCompare

[ Source](https://github.com/dcmunhoz/data-access)[ Packagist](https://packagist.org/packages/dcmunhoz/data-access)[ RSS](/packages/dcmunhoz-data-access/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Data Access
===========

[](#data-access)

*Data Access is a library designed to manipulate databases*

---

Highlights
----------

[](#highlights)

- Easy installation;
- RAW queries execution;

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

[](#installation)

On your prompt use the following command:

```
composer require dcmunhoz/data-access
```

Connection
----------

[](#connection)

To beegin, you need to connect to the database (MySQL / Postgress), check for more databases connections [Here](https://www.php.net/manual/pt_BR/pdo.drivers.php).

Define the following configuration constant:

```
define("DATA_ACCESS", [
  "driver"   => "mysql",
  "host"     => "localhost",
  "port"     => "3306",
  "dbname"   => "DATA_ACCESS_EXAMPLE",
  "user"     => "root",
  "password" => "",
  "options"  => [
      PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
      PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
  ]
]);
```

#### Your model

[](#your-model)

In your controller you can extends data-access or create an object.

```
/**
 * User controller example
 */
class UserController extends DataAccess{

    /**
     * User Constructor
     */
    function __construct(){
        /** \DataAccess::_construct(ENTITY_NAME, PRIMARY_KEY) */
        parent::__construct("TB_USERS", "ID_USER");
    }
}
```

#### RAW execution

[](#raw-execution)

RAW executions allows you to execute whatever query you want.

```
$user = new UserController();

$result = $user->raw("INSERT INTO TB_USERS(USER_NAME, PASSW, ID_PROFILE) VALUES(:uname, :upass, :pid)", [
    ":uname" => "user25",
    ":upass" => "mysupersecretpassword",
    ":pid" => '1'
]);
```

On INSERT, UPDATE or DELETE statement, RAW execution will return true in case of success or false if query fails.

On SELECT statement it will return an array with all found records.

#### fetch

[](#fetch)

fetch() will execute the query, if pass false to params, it will return only the first match, if pass true, will return all records

```
$user = new UserController();

//$result = $user->...->fetch(false);
$result = $user->...->fetch(true);

print_r($result);
```

#### find

[](#find)

find() will return all records from class entity

```
$user = new UserController();

$result = $user->find()->fetch(true);

print_r($result);
```

#### filter

[](#filter)

filter() allows you to create a where statement to find specific records

```
$user = new UserController();

$result = $user->find()->filter("USER_NAME = :uname AND ID_USER = :uid", [":uname" => "USER1", ":uid" => 1])->fetch();

print_r($result);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~11 days

Total

4

Last Release

2357d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.0.1PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/28096004650c073dc3e7c348f3e796264134e68aac6db087f8ff0c810dc70645?d=identicon)[dcmunhoz](/maintainers/dcmunhoz)

---

Top Contributors

[![dcmunhoz](https://avatars.githubusercontent.com/u/23061616?v=4)](https://github.com/dcmunhoz "dcmunhoz (13 commits)")

### Embed Badge

![Health badge](/badges/dcmunhoz-data-access/health.svg)

```
[![Health](https://phpackages.com/badges/dcmunhoz-data-access/health.svg)](https://phpackages.com/packages/dcmunhoz-data-access)
```

###  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.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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