Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: db:table shows db config #7972

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 25, 2023

Description
To make it easy to see which database is being connected to.

$ php spark db:table

CodeIgniter v4.4.1 Command Line Tool - Server Time: 2023-09-25 02:52:48 UTC+00:00

+-----------+----------+----------+----------+----------+------+
| hostname  | database | username | DBDriver | DBPrefix | port |
+-----------+----------+----------+----------+----------+------+
| localhost | ci4      | root     | MySQLi   |          | 3306 |
+-----------+----------+----------+----------+----------+------+

Here is the list of your database tables:
...

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added enhancement PRs that improve existing functionalities 4.5 labels Sep 25, 2023
$data = [[
'hostname' => $this->db->hostname,
'database' => $this->db->getDatabase(),
'username' => $this->db->username,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to protected property username. Although port, hostname are also protected, there is no error for them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a magic getter __get().

Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, this issue should be implemented as an option.

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very fine.

@kenjis kenjis merged commit bfeb6c5 into codeigniter4:4.5 Oct 12, 2023
54 checks passed
@kenjis kenjis deleted the feat-spark-db-table-show-db-config branch October 12, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants