PHPackages                             mage4/magento2-run-sql - 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. mage4/magento2-run-sql

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

mage4/magento2-run-sql
======================

Magento extension to run SQL queries directly from console command.

1.0.0(2y ago)02MITPHPPHP &gt;=7.2

Since Jul 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rehanmobin/magento2-run-sql)[ Packagist](https://packagist.org/packages/mage4/magento2-run-sql)[ RSS](/packages/mage4-magento2-run-sql/feed)WikiDiscussions main Synced today

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

Mage4 RunSql
============

[](#mage4-runsql)

**Magento extension** to run SQL queries directly from console command.

### Install via composer

[](#install-via-composer)

```
composer require mage4/magento2-run-sql

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

```

### Install Package manually by copy-paste

[](#install-package-manually-by-copy-paste)

Download the code from this repo under Magento® 2 following directory:

```
app/code/Mage4/RunSql

```

And run following commands to enable the module:

```
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

```

Features
--------

[](#features)

- Execute DDL queries.
- Execute DML queries.
- Execute DQL queries.

Examples
--------

[](#examples)

- Select records from `store` table:

```
bin/magento mage4:run-sql "select * from store"

```

[![](doc/select_q.png)](doc/select_q.png)

- Insert record into `store` table:

```
bin/magento mage4:run-sql 'insert into store (code, website_id, group_id, name, sort_order, is_
active) VALUES ("test", 1, 1, "Test Store", 0, 0)'

```

[![](doc/insert_q.png)](doc/insert_q.png)

- Delete record from `store` table:

```
bin/magento mage4:run-sql "delete from store where store_id=5"

```

[![](doc/delete_q.png)](doc/delete_q.png)

- Fetch `store` table schema:

```
bin/magento mage4:run-sql "describe store" -f

```

[![](doc/schema_q.png)](doc/schema_q.png)

About us
--------

[](#about-us)

We’re an innovative development agency building awesome websites, webshops and web applications with Latest Technologies. Check out our website [mage4.com](http://mage4.com/) or [email](mailto:contact@mage4.com).

[![](doc/mage4_logo.png)](doc/mage4_logo.png)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

1087d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c2152cb6fb9838a13cb6f533c468a971d14b45580165d84c338e895f8f97bc8?d=identicon)[rehanmobin](/maintainers/rehanmobin)

---

Top Contributors

[![rehanmobin](https://avatars.githubusercontent.com/u/7040684?v=4)](https://github.com/rehanmobin "rehanmobin (5 commits)")

---

Tags

magentomagento 2direct sqlrun mysql querymagento console commandmagento database

### Embed Badge

![Health badge](/badges/mage4-magento2-run-sql/health.svg)

```
[![Health](https://phpackages.com/badges/mage4-magento2-run-sql/health.svg)](https://phpackages.com/packages/mage4-magento2-run-sql)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[magewirephp/magewire

A framework that makes building reactive and dynamic interfaces simple in Magento 2

2621.4M42](/packages/magewirephp-magewire)[yireo/magento2-whoops

Magento 2 module adding Whoops error handling

104756.1k](/packages/yireo-magento2-whoops)[yireo/magento2-integration-test-helper

Magento 2 module to support integration tests in other modules

1637.6k34](/packages/yireo-magento2-integration-test-helper)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.9k2](/packages/opengento-module-category-import-export)[joseph-leedy/module-custom-fees

Adds configurable custom fees to orders

361.1k](/packages/joseph-leedy-module-custom-fees)

PHPackages © 2026

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