From 20c1888116c5ddf917573d6d3fd9dbb9aad11d73 Mon Sep 17 00:00:00 2001 From: Paras Malhotra Date: Mon, 23 Nov 2020 20:46:56 +0530 Subject: [PATCH] [8.x] Document the Artisan db command --- database.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/database.md b/database.md index d692b7e0a83..e057b01a715 100644 --- a/database.md +++ b/database.md @@ -4,6 +4,7 @@ - [Configuration](#configuration) - [Read & Write Connections](#read-and-write-connections) - [Using Multiple Database Connections](#using-multiple-database-connections) +- [Connecting To The Database CLI](#connecting-to-the-database-cli) - [Running Raw SQL Queries](#running-queries) - [Listening For Query Events](#listening-for-query-events) - [Database Transactions](#database-transactions) @@ -103,6 +104,17 @@ You may also access the raw, underlying PDO instance using the `getPdo` method o $pdo = DB::connection()->getPdo(); + +## Connecting To The Database CLI + +If you wish to connect to the database CLI, you may use the `db` Artisan command. This command figures out which database you're using and starts a database CLI session based on your database configuration parameters. + + php artisan db + +You may also specify an optional connection argument to connect to a non-default database connection: + + php artisan db mysql + ## Running Raw SQL Queries