How it is Made
F1 SQL is made using freely available Formula One data provided by the Ergast API, the service provides the files in a CSV format which is downloaded and processed by our build routine.
To do this we download the latest copy of the zip file from the Ergast website using PowerShell, the process it using the following steps
- Extract the zip file into the require location.
- Rename all of the zip files to remove any
_
in the file name. - Process each CSV file to remove any non conforming line endings or terminators from the files.
- Check to make sure that the database exists with the name provided by the user.
- If not create the database.
- Create the required tables in the database created in step 4.
- Process the CSV files inputting them into the corresponding tables.
- Once complete the files are archived and deleted from the source location.
- All of the tables are scripted out for each version of SQL that we support
- Once we are happy that the database has been created a backup is created.
- Once the backup has been created and if the cleanDatabase flag is provided the database will be dropped from the instance.
The Source for the script we use to build the database can be found here