Creating a sqlite3 track

I would vote no. Students can use the create_fixture. We can document how to do that.

1 Like

I would also avoid having binaries in the repository. It is very easy to convert the data.csv to a database file.

year,is_leap
1800,0
1970,0
1996,0
2000,0
2015,0
2100,0

The create_fixture.sql would look like this:

DROP TABLE IF EXISTS leap;
.mode csv
.import ./data.csv leap

If the student wants to have a database.db file to play around, they need to execute:

$ sqlite3 database.db --init create_fixture.sql '.exit' 

The test script can load the data directly from the csv and there is no need to go the extra step of creating a database.

I would include the create_fixture.sql in the folder that is downloaded via the cli and document its use in the HELP.md.

2 Likes

I made a first version of a sqlite-test-runner:

I also want to capture user output, but that will take some more fiddling.

9 Likes