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

[8.x] Add DB command to drop into the database CLI #35304

Merged
merged 8 commits into from
Nov 21, 2020
Merged

[8.x] Add DB command to drop into the database CLI #35304

merged 8 commits into from
Nov 21, 2020

Conversation

paras-malhotra
Copy link
Contributor

@paras-malhotra paras-malhotra commented Nov 20, 2020

Motivation

I currently use many aliases to connect to my database on my Laravel apps. It would be so much easier if we could just run php artisan db or php artisan db --database=mysql to quickly drop into the database CLI! No more aliases to remember for every app and easily switch between connections for apps that have multiple connections. This is similar to what Rails has in the rails db command.

Screenshots

I've tested this on mysql, pgsql and sqlite. I don't have SQL Server but I think it should run without any errors.

Screenshot 2020-11-20 at 5 22 44 PM

@paras-malhotra paras-malhotra changed the title [8.x] Add DB command to open the database CLI [8.x] Add DB command to drop into the database CLI Nov 20, 2020
@driesvints
Copy link
Member

Think you can omit that flag and just make it an optional argument: php artisan db mysql.

@paras-malhotra
Copy link
Contributor Author

paras-malhotra commented Nov 20, 2020

@driesvints makes sense, made the change! Also renamed the title of the argument to connection instead of database to make it more obvious.

@paras-malhotra
Copy link
Contributor Author

@driesvints done! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants