I'm thinking about building a Hype project that is basically a quiz -- it selects questions from an extendable read-only 'database' containing a fairly large number of questions and answers that are classified according to difficulty and subject. Questions within a given subject and difficulty level to be chosen at random. This is fun project for children aged 6 to 10.
At first I thought I'd hard-code the Q & As but clearly that is inefficient and difficult to update. Then I thought I'd create one or more JSON files, but the thought of getting to grips with the complex syntax of JS fetch() and handling all those promises makes me go slightly pale. (I'm not really up to developer level at JS.) And I thought that implementing future changes with a JSON set-up could be quite daunting.
Then I thought what about an SQLite database for the Q & As? I could easily load and edit the database with the DB Browser for SQLite app from SQLitebrowser.org and I could save the .db file in the Hype resources folder. It all sounds very elegant, but how to read from the database with JS functions in the Hype project?
I'm guessing it needs some sort of SQLite library for JS that defines an SQLite object with some associated methods for querying the DB. Does one exist? There is a module for node.js called sqlite3, but I'm not expert enough to say whether that might be relevant to my problem. And there is sql.js on GitHub, but I'm guessing that's for a server-side database. I get the horrible feeling that, in my efforts at simplicity and elegance, I am now swimming into deeper and shark-infested waters. In fact, I swear I can hear the music from Jaws. Should I swim back to wrestling with JSON? Or what?
Any advice or comment much appreciated.