Opened 5 years ago
Closed 5 years ago
#30606 closed Cleanup/optimization (duplicate)
Use .tables for SQLite in tutorial 02
Reported by: | Dinesh Shenoy | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Hello, I suggest a one-word change to the Tutorial 02 -- Database setup section https://docs.djangoproject.com/en/2.2/intro/tutorial02/#database-setup
Which corresponds to this line in the Sphinx docs: https://github.com/django/django/blob/master/docs/intro/tutorial02.txt#L98
I recommend that line be amended to
``.tables`` (SQLite), or ``SELECT TABLE_NAME FROM USER_TABLES;`` (Oracle) to
The one word to be changed is "schema", to be replaced with "tables". I suggest this because the goal at that point in the tutorial is to be able to see the tables which were just created by the "python manage.py migrate" command. Running ".tables" at the sqlite command line shows the tables created:
$ sqlite3 db.sqlite3 SQLite version 3.26.0 2018-12-01 12:34:55 Enter ".help" for usage hints. sqlite> .tables auth_group auth_user_user_permissions auth_group_permissions django_admin_log auth_permission django_content_type auth_user django_migrations auth_user_groups django_session sqlite>
Versus if the ".schema" command is given, that actually outputs all the CREATE TABLE, CREATE INDEX, etc. statements.
Since the sentence in the tutorial says "If you’re interested, run the command-line client for your database . . . to display the tables Django created", I think it will be clearer to say use the ".tables" commands for the default SQLite DB, rather than the ".schema" command.
Thank you.
Change History (1)
comment:1 by , 5 years ago
Component: | Uncategorized → Documentation |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | Suggested tweak to documentation (tutorial 02) → Use .tables for SQLite in tutorial 02 |
Type: | Uncategorized → Cleanup/optimization |
Duplicate of #29874.