On 12 Aug 2019, at 13:51, dboland9 <dbola...@protonmail.com> wrote: > I'm doing an app. that has multiple tables in sqlite. When the app. is run > for the first time, or the tables are lost/damaged, it will create the > database and all tables. My question is if there is a best way to create 5 > tables? > > I can put al the Python code into one function, pass the path to the database > file to multiple functions, or pass the connection to multiple functions. One > function is the most contained, but very large! Any suggestions from those > that have been there done that (BTDT)?
I check for the existence of each database, and if not found then create it from scratch. I also have a globals table in each database, of which one of the columns is a version number. If a new software version expects a later version number, it can apply incremental schema changes. An older software version finding a too-new version number can quit with a message asking the user to upgrade. -- Cheers -- Tim _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users