Giocoso 3 - The Database Management Menu : Import plays to a database

Suppose you created a database called 'renaissance' and a separate database called 'post-renaissance', thinking that keeping the two separate would be useful. Each database thus has its own set of recordings and its own play history. One day, you decide it's pointless keeping the two databases separate in this way, so you create a brand new database called 'classical music'. You get the new database to scan a folder that contains within it both your renaissance and post-renaissance music files. No problem: you now have a single database that contains a RECORDINGS table of both sets of music, created from scratch. But what about the two sets of play histories? How do you port those across to the new database?

This is where the Database Management menu Option 5 comes in handy. You use it to 'point' to a 'source' database and Giocoso will extract the plays out of the source and write them into a second database you 'point' to, the 'destination' database's play history table. You can do that as many times as you like, using different source databases: the plays fetched into the destination database are added to the plays already stored there. So, by running Option 5, pointing to 'renaissance', the plays are pulled into 'classical music'. Run Option 5 again and this time point to 'post-renaissance': the 'classical music' database now contains plays from both source databases: the two original databases have effectively now been merged into one.

Here's a worked example. I start with two databases, one called 'main' and one called 'main Classical database'. Here is the aggregate statistics report for main:

That's a database with data concerning recordings by 603 composers, 13 of which have been played. Now here is the aggregate statistics report for 'main Classical database':

So that's a database with only a single composer's work represented in its database, and with just 5 of those recordings having been played.

My goal now is to create a single database that records 13+5=18 plays!

So, first I create a blank database: for speed, I'll point Giocoso at a folder containing just a single recording for now. Immediately after creation, therefore, this new database's aggregate statistics are:

So, a new database containing just 1 recording by 1 composer ...and zero plays. We are starting with a very blank slate, in other words!

So now I take Database Management menu Option 5:

You are first directed to pick a source database. In my case, that's going to be 'main':

The program now displays all .db files it has found in $HOME/.local/share/giocoso3/db: your job is to use the up- and down-arrows to highlight the required source database and to press the Space Bar when it's highlighted in order to select it. You can only select one source at a time. An asterisk appears in the brackets next to the selected database name. Press [Enter] to proceed:

You are now instructed to select the destination database: the one into which the source's plays will be piped. Note that you can select any database to be the destination: it doesn't have to be the one currently in-use by the main Giocoso program. As before: are presented with a list of all possible databases. You just up- and down-arrow to highlight one and press the Space Bar to select it. In this case, I'm wanting main's plays to be ported across to the 'newclassical' database. Press [Enter] to confirm your selection:

A confirmation is given that the source has X number of plays and that those will be ported across to the newclassical database. You can back out at this point if you prefer: note that 'No' is the default option selected. Were you to just reflexively press [Enter] here, therefore, the import process would end with no harm being done to either database. But I do want to proceed, so I left-arrow to get the 'Yes' option highlighted and only then press [Enter]:

A confirmation message appears: just press [Enter] again to dismiss it. Now, all I have to do is repeat the entire process, just remembering to pick 'main Classical database' as my source database, whilst also remembering to pick 'newclassical' as the destination (as before). This time, I see this:

At this point, I can select the Reporting menu, Option 1 once more:

The newclassical database is now said to contain 1 composer's music as before and only 1 recording... but 18 plays. The plays from the two source databases have been migrated to the new database, just as intended.

I should point out that if you merely want to move an entire database from one PC to another (for example), the simpler procedure is literally to copy the .db file, physically, from one hard disk to another. Physically copying a database in this way moves both the RECORDINGS and the PLAYS tables from one device to another: there is no need in this case to extract the plays and handle them in this special way. Remember, too, that the RECORDINGS table can always be re-constructed from scratch, just by performing a new Full Scan (Option 3) and pointing Giocoso at your music collection's hard disk folders afresh. It is therefore only when you need to preserve just the PLAYS table in a database that this 'Import plays to a database' functionality makes any sense -and that's usually going to be because you wish to merge the plays from multiple prior databases, as I've described here.

Note, finally: an import doesn't delete anything in the destination PLAYS table before running. Imports are therefore cumulative -and there's nothing to stop you importing and re-importing from the same source database multiple times, if you are of a mind so to do.

[ User Manual Home ] | [ Back to Database Management Menu ]