Creating Scripts
Learn how to create scripts to support an application.
We'll cover the following
Why do we need scripts
An application will often need supporting scripts to help it. For example, it may use links to other sites, and we want to make sure that those links are still valid. We could check them one by one, or we could write a script to run through the links, attempt to connect, and show which ones worked and which didn’t.
The most common scripts will be for database management. In this case, we’ll want to make sure that each database has the tables it needs. In some cases, we’ll want to pre-populate a table with records from a file. For example, we could have a particular administrative account we need to make sure is always present. Or maybe we’re creating a game, and all of the levels in the game need to be in the database. Rather than populate the database using the database REPL, it is more maintainable if we write a script to handle it.
Get hands-on with 1200+ tech skills courses.