PHPackages                             alaa/magento2-table-query - 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. alaa/magento2-table-query

AbandonedArchivedMagento2-module[Database &amp; ORM](/categories/database)

alaa/magento2-table-query
=========================

Magento 2 Table Query

1.0.0(7y ago)01MITPHPPHP 7.0.2|7.0.4|~7.0.6|~7.1.0

Since Oct 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/alaa-almaliki/magento2-table-query)[ Packagist](https://packagist.org/packages/alaa/magento2-table-query)[ RSS](/packages/alaa-magento2-table-query/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Magento 2 Table Query
=====================

[](#magento-2-table-query)

A simple module works as a wrapper around Magento connection to perform CRUD operations on a db table

Installation
============

[](#installation)

`composer require alaa/magento2-table-query`

How it works
============

[](#how-it-works)

### Using Factory

[](#using-factory)

```
public function __construct(\Alaa\TableQuery\Model\QueryInterfaceFactory $queryFactory)
{
        $this->queryFactory = $queryFactory;
}

```

### Create query object

[](#create-query-object)

```
$query =  $this->queryFactory->create(['table' => 'my_table', 'primaryId' => 'primary_id']);

```

### Add new records

[](#add-new-records)

```
$data = [
    [
        'name' => 'some name'
        'age' => 33,
        ...
    ],
    [...]
]
$query->put($data);

```

### To Retrieve records use methods start with fetch

[](#to-retrieve-records-use-methods-start-with-fetch)

### To retrieve records and delete them:

[](#to-retrieve-records-and-delete-them)

Retrieve a record based on condition

```
$query->pull('id = 5')

```

Retrieve first record and delete it

```
$query->poll()

```

Retrieve last record and delete it

```
$query->pop()

```

### Truncate a table

[](#truncate-a-table)

```
$query->purge();

```

### Update a record

[](#update-a-record)

```
$query->update(...)

```

### Using the Iterator

[](#using-the-iterator)

```
$it = $query->iterator();

while ($it->valid()) {
    $row = $it->current();
    // ... do something with row
    $it->next();
}

```

Contribution
============

[](#contribution)

Feel free to raise issues and contribute

License
=======

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

2780d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c696bf597ea0fdd1fd166ce20d7c15c873f16547e874bd67ecb70c4abfdb2cb?d=identicon)[alaa-almaliki](/maintainers/alaa-almaliki)

---

Top Contributors

[![alaa-almaliki](https://avatars.githubusercontent.com/u/7830984?v=4)](https://github.com/alaa-almaliki "alaa-almaliki (1 commits)")

---

Tags

magento2magento2-extensionmagento2-modulemagentomagento 2

### Embed Badge

![Health badge](/badges/alaa-magento2-table-query/health.svg)

```
[![Health](https://phpackages.com/badges/alaa-magento2-table-query/health.svg)](https://phpackages.com/packages/alaa-magento2-table-query)
```

###  Alternatives

[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[yireo/magento2-whoops

Magento 2 module adding Whoops error handling

102703.5k](/packages/yireo-magento2-whoops)[yireo/magento2-next-gen-images

Magento 2 module to add NextGen images support to the Magento frontend

471.1M2](/packages/yireo-magento2-next-gen-images)[yireo/magento2-integration-test-helper

Magento 2 module to support integration tests in other modules

1633.2k19](/packages/yireo-magento2-integration-test-helper)[zero1/open-pos

125.4k2](/packages/zero1-open-pos)

PHPackages © 2026

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