mage4 / magento2-run-sql

Magento 扩展,可直接从控制台命令运行 SQL 查询。

安装: 2

依赖关系: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型: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 扩展,可直接从控制台命令运行 SQL 查询。

使用 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

手动复制粘贴安装包

从以下目录下载此存储库中的代码,在 Magento® 2 中

app/code/Mage4/RunSql

运行以下命令以启用模块

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

功能

  • 执行 DDL 查询。
  • 执行 DML 查询。
  • 执行 DQL 查询。

示例

  • store 表中选择记录
bin/magento mage4:run-sql "select * from store"

  • store 表中插入记录
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)'

  • store 表中删除记录
bin/magento mage4:run-sql "delete from store where store_id=5"

  • 获取 store 表的架构
bin/magento mage4:run-sql "describe store" -f

关于我们

我们是一家创新型开发机构,使用最新技术构建出色的网站、网店和 Web 应用程序。访问我们的网站 mage4.com发送电子邮件