[Tutor] How is database creation normally handled?

boB Stepp robertvstepp at gmail.com
Sat Sep 9 20:29:49 EDT 2017


While reading about SQL, SQLite and the Python module sqlite3, it
appears that I could (1) have a program check for the existence of the
program's database, and if not found, create it, make the tables,
etc.; or, (2) create the database separately and include it with the
program.  What are the pros and cons of each approach?  (1) to me
looks only helpful if I wish to write a program that might want to
allow the user to have multiple databases.  But this sounds like a lot
of extra coding and checking to make it work well.  But if I only wish
to have a single database, then (2) sounds like the approach to use.
I would create the database, populate it with the needed empty tables
with the desired fields, making it ready to use by the program's user.

Not having any experience in the database arena, I'm not even sure I
know how to properly think about this.

-- 
boB


More information about the Tutor mailing list