I'm confused by your requirements to send sensor data to a database "at the click of a button" so you can get a "printable record"... If you really just want to click a button and print a record, you just need to append your sensor readings to a file. Then when the button is pressed, read the file and send the data to the user (or printer, or whatever).
Normally, the sensor data will be sent or polled periodically, and as soon as it's received by the flow through the mqtt in node, it would be added to the database in a background flow. Then, in another flow (maybe with a UI), when someone wants to see what has been happening, a database node is used to query the database for the needed time period, and the data is sent to a chart or file for viewing or printing. Is this more like what you are needing to do?
Is so, then the question is how to convert the msg.payload output from mqtt to the appropriate msg.topic as input to the database node. I've used the change node, function nodes, and template nodes, depending on how complex the data is, and how long the topic string will be. I have not used sqlite, so i can't tell you what the topic string should look like, but it's usually something like:
insert into tablename (col1, col2, col3, ...) values ("str1", "val2", num3)
Good luck.