mage4/magento2-run-sql

Magento extension to run SQL queries directly from console command.

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:magento2-module

1.0.0 2023-07-12 12:24 UTC

This package is auto-updated.

Last update: 2024-09-26 18:08:47 UTC


README

Magento extension to run SQL queries directly from console command.

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

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

  • Execute DDL queries.
  • Execute DML queries.
  • Execute DQL queries.

Examples

  • Select records from store table:
bin/magento mage4:run-sql "select * from store"

  • 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)'

  • Delete record from store table:
bin/magento mage4:run-sql "delete from store where store_id=5"

  • Fetch store table schema:
bin/magento mage4:run-sql "describe store" -f

About us

We’re an innovative development agency building awesome websites, webshops and web applications with Latest Technologies. Check out our website mage4.com or email.