PHPackages                             davidfricker/dataabstracter - 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. davidfricker/dataabstracter

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

davidfricker/dataabstracter
===========================

Minimalist data abstraction and pseudo content provider framework

3(9y ago)26211MITPHPPHP ^5.3.3 || ^7.0

Since Feb 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DavidFricker/DataAbstracter)[ Packagist](https://packagist.org/packages/davidfricker/dataabstracter)[ RSS](/packages/davidfricker-dataabstracter/feed)WikiDiscussions master Synced today

READMEChangelog (7)DependenciesVersions (8)Used By (1)

DataAbstracter
==============

[](#dataabstracter)

This package is a wrapper around the PDO DBMS driver. It enables easy paramterisation of queries with one function call, aditionally it expoess CRUD operations.

Install
-------

[](#install)

Using composer `composer require DavidFricker/DataAbstracter`

Usage
-----

[](#usage)

```
use DavidFricker\DataAbstracter\Adapter\MySQLDatabaseWrapper ;

$MySQLDatabaseWrapper = new MySQLDatabaseWrapper($dsn, $username, $password);
```

API
---

[](#api)

### delete()

[](#delete)

Remove one or more rows. As this is intended to be a simple helper function the only 'glue' to hold together the where clauses is 'AND' more complex delete statements should be performed using `run()`.

#### Example

[](#example)

```
$where = ['col_name' => 'expected_value'];
$limit = 10;
$MySQLDatabaseWrapper->delete('table_name', $where, $limit);
```

### update()

[](#update)

Update one or more rows. This is intended to be a simple helper function the only 'glue' to hold together the where clauses is 'AND' more complex update statements should be performed using `run()`.

#### Example

[](#example-1)

```
$data = ['col_name' => 'new_value'];
$where = ['col_name' => 'expected_value'];
$limit = 10;
$MySQLDatabaseWrapper->update('table_name', $data, $where, $limit);
```

### fetch()

[](#fetch)

Pull one or more rows. As this is intended to be a simple helper function the only 'glue' to hold together the where clauses is 'AND' more complex update statements should be performed using `run()`. IMPORTANT: Ensure the $columns variable does not contain user input as it is inserted as-is into the statement and as so creates an SQL injection vulnerable.

#### Example

[](#example-2)

```
$columns = ['col_name_1', 'col_name_2'];
$where = ['col_name' => 'expected_value'];
$limit = 10;
$MySQLDatabaseWrapper->fetch('table_name', $columns, $where, $limit);
```

### insert()

[](#insert)

Create a new row.

#### Example

[](#example-3)

```
$data = ['col_name_1' => 'new_value', 'col_name_2' => 'new_value'];
$MySQLDatabaseWrapper->insert('table_name', $data);
```

### run()

[](#run)

Execute any SQL query. To ensure your query is safe from SQL injection attacks pass all values via the `$bind` array.

#### Example

[](#example-4)

```
$new_record = ['col_name_1' => 'new_value', 'col_name_2' => 'new_value'];
$MySQLDatabaseWrapper->insert('table_name', $new_record);
```

### rowCount()

[](#rowcount)

Fetch the number of rows returned from the last query performed.

#### Example

[](#example-5)

```
$new_record = ['col_name_1' => 'new_value', 'col_name_2' => 'new_value'];
$MySQLDatabaseWrapper->insert('table_name', $new_record);
```

Bugs
----

[](#bugs)

Please report bugs by creating an issue and supply code to replicate the issue. Code contributions are always welcome.

Licence
-------

[](#licence)

Released under the MIT licenses.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~12 days

Recently: every ~18 days

Total

7

Last Release

3358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b261da4583f1c88fcf9d392ba06c680083a0420c077ce954ec8d0c20d4f398c?d=identicon)[sousdev](/maintainers/sousdev)

---

Top Contributors

[![DavidFricker](https://avatars.githubusercontent.com/u/6656039?v=4)](https://github.com/DavidFricker "DavidFricker (9 commits)")[![simondoescode](https://avatars.githubusercontent.com/u/5481261?v=4)](https://github.com/simondoescode "simondoescode (1 commits)")

---

Tags

contentproviderdatabasemysqlphp

### Embed Badge

![Health badge](/badges/davidfricker-dataabstracter/health.svg)

```
[![Health](https://phpackages.com/badges/davidfricker-dataabstracter/health.svg)](https://phpackages.com/packages/davidfricker-dataabstracter)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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