syjust/sf-db-cmd

Symfony 数据库命令

安装: 14

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

1.1.1 2024-07-18 16:00 UTC

This package is auto-updated.

Last update: 2024-09-18 17:08:03 UTC


README

描述

laravel/framework DbCommand 的拷贝/改编

  • 用于通过命令行界面轻松访问您的数据库,
  • 基于 symfony/console, symfony/process & doctrine/orm 库。

安装

首先,在项目中添加依赖。

composer require syjust/sf-db-cmd

然后在 config/bundles.php 文件中添加以下行。

// ...
    Syjust\SfDbCmd\DbCommandBundle::class => ['all' => true],
// ...

用法

# connecting interactively into the database
php bin/console db

限制

该命令目前只在交互模式下与 pdo_mysql & pdo_sqlite 进行了测试。

贡献

已知问题

如果您收到以下消息

TTY mode requires /dev/tty to be read/writable.
  1. 确保在 shell 模式下 /dev/tty 可写(echo foobar >> /dev/tty)。
  2. 确保您正在基于 Unix 的操作系统上(/ 是目录分隔符)。
  3. 确保 PHP 能够写入 /dev/tty<?php is_writable('/dev/tty') ?>)。如果最新测试失败:请将 ':/dev/tty' 添加到您的 php.ini 中的 open_basedir 配置中。