4

How do I exit dbshell (SQLite 3) on the command line when using Django?

It's my first time to use the command. I watch a book and am practicing Django at the same time. After I run this command, I have no idea how to leave the environment since I have never learned SQL before.

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Philipl
  • 395
  • 4
  • 21

6 Answers6

9

The exit key is determined by what SQL back end you're running.

If it's SQLite 3, like this question, it should be quit.

If it's PostgreSQL, like my case, it's \q.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64
3

You can type .exit in thew shell to exit. For more information about commands, type .help.

It raises an error and exits ... it was helpful :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Himen
  • 1,440
  • 12
  • 18
3

You may use '.quit' to exit the SQLite shell. Please mind the dot in front.

More reference from here: SQLite CLI

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
abhishek kumar
  • 339
  • 3
  • 11
1

Just typing quit does the work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Philipl
  • 395
  • 4
  • 21
1

You can just hit the key combination Ctrl + C.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

These commands below work on Windows to exit SQLite and django dbshell's SQLite:

.exit

Or:

.quit

But these commands below without a dot don't work on Windows to exit SQLite and django dbshell's SQLite:

exit

Or:

quit
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129